Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfd78a53

Browse files
committed
One approach to the symlink-following bug
1 parent5335416 commitfd78a53

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

‎git/util.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def patch_env(name: str, value: str) -> Generator[None, None, None]:
197197
os.environ[name]=old_value
198198

199199

200-
defrmtree(path:PathLike)->None:
200+
def_rmtree_windows(path:PathLike)->None:
201201
"""Remove the given directory tree recursively.
202202
203203
:note: We use :func:`shutil.rmtree` but adjust its behaviour to see whether files
@@ -225,6 +225,17 @@ def handler(function: Callable, path: PathLike, _excinfo: Any) -> None:
225225
shutil.rmtree(path,onerror=handler)
226226

227227

228+
def_rmtree_posix(path:PathLike)->None:
229+
"""Remove the given directory tree recursively."""
230+
returnshutil.rmtree(path)
231+
232+
233+
ifos.name=="nt":
234+
rmtree=_rmtree_windows
235+
else:
236+
rmtree=_rmtree_posix
237+
238+
228239
defrmfile(path:PathLike)->None:
229240
"""Ensure file deleted also on *Windows* where read-only files need special treatment."""
230241
ifosp.isfile(path):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp