summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorSkyler Kaufman <skyler@google.com>2011-03-08 12:14:41 -0800
committerSkyler Kaufman <skyler@google.com>2011-03-08 13:48:24 -0800
commit835cd6888f16ff30a3428adfa3a775efad918880 (patch)
tree8570e971b5e44a0d75341f8eb467ab19e0a09529 /project.py
parent8ced8641c88d37891a46d42ac1805e380ef6c377 (diff)
downloadgit-repo-835cd6888f16ff30a3428adfa3a775efad918880.tar.gz
Post-nonexistent-revision crash sidestepped
Fix for the bug that leaves a fractional .git directory after attempting to perform an initial sync to a nonexistent revision. Moved the initialization of the working directory to after the revision ID has already been checked. Now, no project/.git directory gets created at all if the revision ID is bad. Change-Id: I0c9b2a59573410f1d11de7661591bf02e4ce326b
Diffstat (limited to 'project.py')
-rw-r--r--project.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/project.py b/project.py
index 125fb48c..37f6d36a 100644
--- a/project.py
+++ b/project.py
@@ -691,11 +691,11 @@ class Project(object):
691 """Perform only the local IO portion of the sync process. 691 """Perform only the local IO portion of the sync process.
692 Network access is not required. 692 Network access is not required.
693 """ 693 """
694 self._InitWorkTree()
695 all = self.bare_ref.all 694 all = self.bare_ref.all
696 self.CleanPublishedCache(all) 695 self.CleanPublishedCache(all)
697
698 revid = self.GetRevisionId(all) 696 revid = self.GetRevisionId(all)
697
698 self._InitWorkTree()
699 head = self.work_git.GetHead() 699 head = self.work_git.GetHead()
700 if head.startswith(R_HEADS): 700 if head.startswith(R_HEADS):
701 branch = head[len(R_HEADS):] 701 branch = head[len(R_HEADS):]