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
This commit is contained in:
@ -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, "/.");
|
||||
|
||||
|
Reference in New Issue
Block a user