summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorMike Frysinger <vapier@google.com>2021-02-28 17:08:55 -0500
committerMike Frysinger <vapier@google.com>2021-03-01 15:57:12 +0000
commit76844ba2926b53ed56f2275365a6518d11310b95 (patch)
tree59d688781f4f5fccf3e9a40b7346d518755547f6 /project.py
parent6d1faa1db35439b267a7b10725ab0876f027ecb6 (diff)
downloadgit-repo-76844ba2926b53ed56f2275365a6518d11310b95.tar.gz
project: skip clone bundles when we've already initialized the object dir
The clone bundle logic assumes there is a one-to-one mapping between the projects/ and project-objects/ trees. When using shared projects (where we checkout different branches from the same project), this would lead us to fetching the same clone bundle multiple times. Automatically skip the clone bundle logic if the project-objects/ dir already exists. Bug: https://crbug.com/gerrit/10993 Change-Id: I82c6fa1faf8605fd56c104fcea2a43dd4eecbce4 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/298682 Reviewed-by: Michael Mortensen <mmortensen@google.com> Tested-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'project.py')
-rw-r--r--project.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/project.py b/project.py
index b81c10a1..dbc3ae61 100644
--- a/project.py
+++ b/project.py
@@ -1081,6 +1081,12 @@ class Project(object):
1081 _warn("Cannot remove archive %s: %s", tarpath, str(e)) 1081 _warn("Cannot remove archive %s: %s", tarpath, str(e))
1082 self._CopyAndLinkFiles() 1082 self._CopyAndLinkFiles()
1083 return True 1083 return True
1084
1085 # If the shared object dir already exists, don't try to rebootstrap with a
1086 # clone bundle download. We should have the majority of objects already.
1087 if clone_bundle and os.path.exists(self.objdir):
1088 clone_bundle = False
1089
1084 if is_new is None: 1090 if is_new is None:
1085 is_new = not self.Exists 1091 is_new = not self.Exists
1086 if is_new: 1092 if is_new: