◐ Shell
reader mode source ↗
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
17 changes: 16 additions & 1 deletion git/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def wrapper(self: "Remote", *args: Any, **kwargs: Any) -> T:

@contextlib.contextmanager
def cwd(new_dir: PathLike) -> Generator[PathLike, None, None]:
old_dir = os.getcwd()
os.chdir(new_dir)
try:
Expand All @@ -158,6 +159,20 @@ def cwd(new_dir: PathLike) -> Generator[PathLike, None, None]:
os.chdir(old_dir)


def rmtree(path: PathLike) -> None:
"""Remove the given recursively.

Expand Down Expand Up @@ -935,7 +950,7 @@ def _obtain_lock_or_raise(self) -> None:
)

try:
with open(lock_file, mode='w'):
pass
except OSError as e:
raise IOError(str(e)) from e
Expand Down
13 changes: 13 additions & 0 deletions test/fixtures/env_case.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Toggle all file notes Toggle all file annotations