summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2016-04-05 17:22:02 -0700
committerDan Willemsen <dwillemsen@google.com>2016-04-05 17:44:09 -0700
commitbdb866ea7630b1aecad0ddc7d72939e67ff39816 (patch)
tree73dd76e6cc3753783e95c5de50e08d4a27485996 /project.py
parente121ad558dac2268bba4eb37528ec5a6a2aa507d (diff)
downloadgit-repo-bdb866ea7630b1aecad0ddc7d72939e67ff39816.tar.gz
Fix symlinking of new projects
We weren't copying these lists, so the += was actually changing the underlying lists. When a new project was added to the manifest, we run _CheckDirReference against the manifest project with share_refs=True, which added the working_tree_* to the shareable_* lists. Then, when we load the new manifest and create the new project, it uses the lists that already contain the working_tree_* files, even though we passed share_refs=False. This happens reliably under the above conditions, but doesn't seem to happen when syncing a fresh tree. So we've got a mixture of links that may need to be cleaned up later. This patch will just stop it from happening in the future. Change-Id: Ib7935bfad78af1e494a75e55134ec829f13c2a41
Diffstat (limited to 'project.py')
-rw-r--r--project.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/project.py b/project.py
index e3c3bd51..e0bd9c10 100644
--- a/project.py
+++ b/project.py
@@ -2315,8 +2315,8 @@ class Project(object):
2315 self.bare_git.symbolic_ref('-m', msg, ref, dst) 2315 self.bare_git.symbolic_ref('-m', msg, ref, dst)
2316 2316
2317 def _CheckDirReference(self, srcdir, destdir, share_refs): 2317 def _CheckDirReference(self, srcdir, destdir, share_refs):
2318 symlink_files = self.shareable_files 2318 symlink_files = self.shareable_files[:]
2319 symlink_dirs = self.shareable_dirs 2319 symlink_dirs = self.shareable_dirs[:]
2320 if share_refs: 2320 if share_refs:
2321 symlink_files += self.working_tree_files 2321 symlink_files += self.working_tree_files
2322 symlink_dirs += self.working_tree_dirs 2322 symlink_dirs += self.working_tree_dirs
@@ -2344,8 +2344,8 @@ class Project(object):
2344 copy_all: If true, copy all remaining files from |gitdir| -> |dotgit|. 2344 copy_all: If true, copy all remaining files from |gitdir| -> |dotgit|.
2345 This saves you the effort of initializing |dotgit| yourself. 2345 This saves you the effort of initializing |dotgit| yourself.
2346 """ 2346 """
2347 symlink_files = self.shareable_files 2347 symlink_files = self.shareable_files[:]
2348 symlink_dirs = self.shareable_dirs 2348 symlink_dirs = self.shareable_dirs[:]
2349 if share_refs: 2349 if share_refs:
2350 symlink_files += self.working_tree_files 2350 symlink_files += self.working_tree_files
2351 symlink_dirs += self.working_tree_dirs 2351 symlink_dirs += self.working_tree_dirs