From d957ec6a834e333a3812546911f786b0c20b808f Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 24 Feb 2020 14:40:25 -0500 Subject: manifest_xml: skip config lookup during first init Trying to use the config state when the git tree hasn't yet been created hits bad side effects. Add a check to avoid probing the config logic during the first run. It's not clear what's going wrong at the lower layers, but this gets us back to the behavior before we added worktree support, so lets settle the status quo. Bug: https://crbug.com/gerrit/12387 Change-Id: I85b56797455f3c2e249d02c18496e060be05501d Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256592 Reviewed-by: Xin Li Reviewed-by: Mike Frysinger Tested-by: Mike Frysinger --- manifest_xml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest_xml.py b/manifest_xml.py index a3effd11..fe09f498 100644 --- a/manifest_xml.py +++ b/manifest_xml.py @@ -155,7 +155,7 @@ class XmlManifest(object): # normal repo settings live in the manifestProject which we just setup # above, so we couldn't easily query before that. We assume Project() # init doesn't care if this changes afterwards. - if mp.config.GetBoolean('repo.worktree'): + if os.path.exists(mp.gitdir) and mp.config.GetBoolean('repo.worktree'): mp.use_git_worktrees = True self._Unload() -- cgit v1.2.3-54-g00ecf