Commit 157b19e3 authored by Eric S. Raymond's avatar Eric S. Raymond

Prevent a fatal error when preserving directories.

parent 587d9926
......@@ -6538,6 +6538,8 @@ def rebuild_repo(repo, target, options, preferred):
src = os.path.join(savedir, sub)
dst = os.path.join(target, sub)
if os.path.exists(src):
if os.path.exists(dst) and os.path.isdir(dst):
shutil.rmtree(dst)
if os.path.isdir(src):
shutil.copytree(src, dst)
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment