Przeglądaj źródła

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
Skyler Kaufman 15 lat temu
rodzic
commit
835cd6888f
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      project.py

+ 2 - 2
project.py

@@ -691,11 +691,11 @@ class Project(object):
     """Perform only the local IO portion of the sync process.
     """Perform only the local IO portion of the sync process.
        Network access is not required.
        Network access is not required.
     """
     """
-    self._InitWorkTree()
     all = self.bare_ref.all
     all = self.bare_ref.all
     self.CleanPublishedCache(all)
     self.CleanPublishedCache(all)
-
     revid = self.GetRevisionId(all)
     revid = self.GetRevisionId(all)
+
+    self._InitWorkTree()
     head = self.work_git.GetHead()
     head = self.work_git.GetHead()
     if head.startswith(R_HEADS):
     if head.startswith(R_HEADS):
       branch = head[len(R_HEADS):]
       branch = head[len(R_HEADS):]