Merge branch 'jc/checkout-detach-wo-tracking-report'
"git checkout/switch --detach foo", after switching to the detached HEAD state, gave the tracking information for the 'foo' branch, which was pointless. Tested-by: M Hickford <mirth.hickford@gmail.com> cf. <CAGJzqsmE9FDEBn=u3ge4LA3ha4fDbm4OWiuUbMaztwjELBd7ug@mail.gmail.com> * jc/checkout-detach-wo-tracking-report: checkout: omit "tracking" information on a detached HEAD
This commit is contained in:
@ -1035,7 +1035,8 @@ static void update_refs_for_switch(const struct checkout_opts *opts,
|
||||
remove_branch_state(the_repository, !opts->quiet);
|
||||
strbuf_release(&msg);
|
||||
if (!opts->quiet &&
|
||||
(new_branch_info->path || (!opts->force_detach && !strcmp(new_branch_info->name, "HEAD"))))
|
||||
!opts->force_detach &&
|
||||
(new_branch_info->path || !strcmp(new_branch_info->name, "HEAD")))
|
||||
report_tracking(new_branch_info);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user