Skip to content

Commit

Permalink
repo: Use the worktree when checking the repo rev.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Tested-by: Jason R. Coombs <[email protected]>
Tested-by: Emily Shaffer <[email protected]>
Reviewed-by: Emily Shaffer <[email protected]>
Reviewed-by: Mike Frysinger <[email protected]>
  • Loading branch information
jaraco authored and LUCI committed Nov 13, 2023
1 parent 8a6d172 commit 560a797
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion subcmds/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ def Execute(self, opt, args):
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,
Expand Down

0 comments on commit 560a797

Please sign in to comment.