From 560a79727f5c9ec9ff16544159b444eeb42295ee Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 1 Nov 2023 10:35:30 -0400 Subject: [PATCH] repo: Use the worktree when checking the repo rev. Avoids treating the operation as if it were acting on a bare repository, thereby triggering failures when the Git client is configured with `safe.bareRepository=explicit`. Repo doesn't actually use a bare repository, but pointing at the gitdir acts as if it had. Bug: 307559774 Change-Id: I2c142275b2726a59526729c0b2c54faf728f125d Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/391554 Commit-Queue: Jason R. Coombs Tested-by: Jason R. Coombs Tested-by: Emily Shaffer Reviewed-by: Emily Shaffer Reviewed-by: Mike Frysinger --- subcmds/init.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subcmds/init.py b/subcmds/init.py index 44517877..e53d0338 100644 --- a/subcmds/init.py +++ b/subcmds/init.py @@ -353,7 +353,7 @@ to update the working directory files. wrapper = Wrapper() try: remote_ref, rev = wrapper.check_repo_rev( - rp.gitdir, + rp.worktree, opt.repo_rev, repo_verify=opt.repo_verify, quiet=opt.quiet,