Skip to content

Commit

Permalink
status: factor two rebase-related messages together
Browse files Browse the repository at this point in the history
Signed-off-by: Guillaume Pagès <guillaume.pages@ensimag.grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Guillaume Pagès authored and Junio C Hamano committed Jun 30, 2015
1 parent 7974889 commit 05eb563
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions wt-status.c
Original file line number Diff line number Diff line change
Expand Up @@ -1026,21 +1026,28 @@ static int split_commit_in_progress(struct wt_status *s)
return split_in_progress;
}

static void print_rebase_state(struct wt_status *s,
struct wt_status_state *state,
const char *color)
{
if (state->branch)
status_printf_ln(s, color,
_("You are currently rebasing branch '%s' on '%s'."),
state->branch,
state->onto);
else
status_printf_ln(s, color,
_("You are currently rebasing."));
}

static void show_rebase_in_progress(struct wt_status *s,
struct wt_status_state *state,
const char *color)
{
struct stat st;

if (has_unmerged(s)) {
if (state->branch)
status_printf_ln(s, color,
_("You are currently rebasing branch '%s' on '%s'."),
state->branch,
state->onto);
else
status_printf_ln(s, color,
_("You are currently rebasing."));
print_rebase_state(s, state, color);
if (s->hints) {
status_printf_ln(s, color,
_(" (fix conflicts and then run \"git rebase --continue\")"));
Expand All @@ -1050,14 +1057,7 @@ static void show_rebase_in_progress(struct wt_status *s,
_(" (use \"git rebase --abort\" to check out the original branch)"));
}
} else if (state->rebase_in_progress || !stat(git_path("MERGE_MSG"), &st)) {
if (state->branch)
status_printf_ln(s, color,
_("You are currently rebasing branch '%s' on '%s'."),
state->branch,
state->onto);
else
status_printf_ln(s, color,
_("You are currently rebasing."));
print_rebase_state(s, state, color);
if (s->hints)
status_printf_ln(s, color,
_(" (all conflicts fixed: run \"git rebase --continue\")"));
Expand Down

0 comments on commit 05eb563

Please sign in to comment.