diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-03-05 21:43:02 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-03-05 21:43:03 +0300 |
commit | 4a2e91db652e197803c6f29e2c2f1c9dfbc16506 (patch) | |
tree | abae7a1c8eb6eeb0d57f561725122341c3e07fe7 /worktree.c | |
parent | 49e5043b09fffb0411e8bae19d60014e72a36fd0 (diff) | |
parent | 4d864895a23bbbb5403d9aa8a65d0576d2029597 (diff) |
Merge branch 'hv/receive-denycurrent-everywhere'
"git push" should stop from updating a branch that is checked out
when receive.denyCurrentBranch configuration is set, but it failed
to pay attention to checkouts in secondary worktrees. This has
been corrected.
* hv/receive-denycurrent-everywhere:
t2402: test worktree path when called in .git directory
receive.denyCurrentBranch: respect all worktrees
t5509: use a bare repository for test push target
get_main_worktree(): allow it to be called in the Git directory
Diffstat (limited to 'worktree.c')
-rw-r--r-- | worktree.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/worktree.c b/worktree.c index 52971f7082..eba4fd3a03 100644 --- a/worktree.c +++ b/worktree.c @@ -50,6 +50,7 @@ static struct worktree *get_main_worktree(void) struct strbuf worktree_path = STRBUF_INIT; strbuf_add_absolute_path(&worktree_path, get_git_common_dir()); + strbuf_strip_suffix(&worktree_path, "/."); if (!strbuf_strip_suffix(&worktree_path, "/.git")) strbuf_strip_suffix(&worktree_path, "/."); |