Merge branch 'rj/status-bisect-while-rebase' into maint-2.43

"git status" is taught to show both the branch being bisected and
being rebased when both are in effect at the same time.
cf. <xmqqil76kyov.fsf@gitster.g>

* rj/status-bisect-while-rebase:
  status: fix branch shown when not only bisecting
This commit is contained in:
Junio C Hamano
2024-02-08 16:22:04 -08:00
6 changed files with 38 additions and 8 deletions

View File

@ -861,6 +861,7 @@ void wt_status_state_free_buffers(struct wt_status_state *state)
FREE_AND_NULL(state->branch);
FREE_AND_NULL(state->onto);
FREE_AND_NULL(state->detached_from);
FREE_AND_NULL(state->bisecting_from);
}
static void wt_longstatus_print_unmerged(struct wt_status *s)
@ -1569,10 +1570,10 @@ static void show_revert_in_progress(struct wt_status *s,
static void show_bisect_in_progress(struct wt_status *s,
const char *color)
{
if (s->state.branch)
if (s->state.bisecting_from)
status_printf_ln(s, color,
_("You are currently bisecting, started from branch '%s'."),
s->state.branch);
s->state.bisecting_from);
else
status_printf_ln(s, color,
_("You are currently bisecting."));
@ -1733,7 +1734,7 @@ int wt_status_check_bisect(const struct worktree *wt,
if (!stat(worktree_git_path(wt, "BISECT_LOG"), &st)) {
state->bisect_in_progress = 1;
state->branch = get_branch(wt, "BISECT_START");
state->bisecting_from = get_branch(wt, "BISECT_START");
return 1;
}
return 0;