summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--project.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/project.py b/project.py
index 8fec9816..de1ab3c6 100644
--- a/project.py
+++ b/project.py
@@ -3443,11 +3443,18 @@ class Project:
3443 3443
3444 # Finish checking out the worktree. 3444 # Finish checking out the worktree.
3445 cmd = ["read-tree", "--reset", "-u", "-v", HEAD] 3445 cmd = ["read-tree", "--reset", "-u", "-v", HEAD]
3446 if GitCommand(self, cmd).Wait() != 0: 3446 try:
3447 raise GitError( 3447 if GitCommand(self, cmd).Wait() != 0:
3448 "Cannot initialize work tree for " + self.name, 3448 raise GitError(
3449 project=self.name, 3449 "Cannot initialize work tree for " + self.name,
3450 ) 3450 project=self.name,
3451 )
3452 except Exception as e:
3453 # Something went wrong with read-tree (perhaps fetching
3454 # missing blobs), so remove .git to avoid half initialized
3455 # workspace from which repo can't recover on its own.
3456 platform_utils.remove(dotgit)
3457 raise e
3451 3458
3452 if submodules: 3459 if submodules:
3453 self._SyncSubmodules(quiet=True) 3460 self._SyncSubmodules(quiet=True)