summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
Diffstat (limited to 'project.py')
-rw-r--r--project.py14
1 files changed, 2 insertions, 12 deletions
diff --git a/project.py b/project.py
index 48287858..edd748d0 100644
--- a/project.py
+++ b/project.py
@@ -457,7 +457,6 @@ class RemoteSpec(object):
457 457
458class Project(object): 458class Project(object):
459 # These objects can be shared between several working trees. 459 # These objects can be shared between several working trees.
460 shareable_files = []
461 shareable_dirs = ['hooks', 'objects', 'rr-cache'] 460 shareable_dirs = ['hooks', 'objects', 'rr-cache']
462 461
463 def __init__(self, 462 def __init__(self,
@@ -2651,10 +2650,7 @@ class Project(object):
2651 if self.use_git_worktrees: 2650 if self.use_git_worktrees:
2652 return 2651 return
2653 2652
2654 symlink_files = self.shareable_files[:] 2653 for name in self.shareable_dirs:
2655 symlink_dirs = self.shareable_dirs[:]
2656 to_symlink = symlink_files + symlink_dirs
2657 for name in set(to_symlink):
2658 # Try to self-heal a bit in simple cases. 2654 # Try to self-heal a bit in simple cases.
2659 dst_path = os.path.join(destdir, name) 2655 dst_path = os.path.join(destdir, name)
2660 src_path = os.path.join(srcdir, name) 2656 src_path = os.path.join(srcdir, name)
@@ -2680,9 +2676,8 @@ class Project(object):
2680 copy_all: If true, copy all remaining files from |gitdir| -> |dotgit|. 2676 copy_all: If true, copy all remaining files from |gitdir| -> |dotgit|.
2681 This saves you the effort of initializing |dotgit| yourself. 2677 This saves you the effort of initializing |dotgit| yourself.
2682 """ 2678 """
2683 symlink_files = self.shareable_files[:]
2684 symlink_dirs = self.shareable_dirs[:] 2679 symlink_dirs = self.shareable_dirs[:]
2685 to_symlink = symlink_files + symlink_dirs 2680 to_symlink = symlink_dirs
2686 2681
2687 to_copy = [] 2682 to_copy = []
2688 if copy_all: 2683 if copy_all:
@@ -2710,11 +2705,6 @@ class Project(object):
2710 elif os.path.isfile(src): 2705 elif os.path.isfile(src):
2711 shutil.copy(src, dst) 2706 shutil.copy(src, dst)
2712 2707
2713 # If the source file doesn't exist, ensure the destination
2714 # file doesn't either.
2715 if name in symlink_files and not os.path.lexists(src):
2716 platform_utils.remove(dst, missing_ok=True)
2717
2718 except OSError as e: 2708 except OSError as e:
2719 if e.errno == errno.EPERM: 2709 if e.errno == errno.EPERM:
2720 raise DownloadError(self._get_symlink_error_message()) 2710 raise DownloadError(self._get_symlink_error_message())