status: factor two rebase-related messages together
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>
Guillaume Pagès committed
Jun 30, 2015 at 15:01 UTC
05eb5635537bac0494bfd8cf41fa5502e05b6fd6
1 file changed
+16
-16
wt-status.c
+16
-16
@@ -1026,6 +1026,20 @@ static int split_commit_in_progress(struct wt_status *s)
1026
return split_in_progress;
1027
}
1028
1029
+static void print_rebase_state(struct wt_status *s,
1030
+ struct wt_status_state *state,
1031
+ const char *color)
1032
+{
1033
+ if (state->branch)
1034
+ status_printf_ln(s, color,
1035
+ _("You are currently rebasing branch '%s' on '%s'."),
1036
+ state->branch,
1037
+ state->onto);
1038
+ else
1039
+ status_printf_ln(s, color,
1040
+ _("You are currently rebasing."));
1041
+}
1042
+
1043
static void show_rebase_in_progress(struct wt_status *s,
1044
struct wt_status_state *state,
1045
const char *color)
@@ -1033,14 +1047,7 @@ static void show_rebase_in_progress(struct wt_status *s,
1047
struct stat st;
1048
1049
if (has_unmerged(s)) {
1036
- if (state->branch)
1037
- status_printf_ln(s, color,
1038
- _("You are currently rebasing branch '%s' on '%s'."),
1039
- state->branch,
1040
- state->onto);
1041
- else
1042
- status_printf_ln(s, color,
1043
- _("You are currently rebasing."));
1050
+ print_rebase_state(s, state, color);
1051
if (s->hints) {
1052
status_printf_ln(s, color,
1053
_(" (fix conflicts and then run \"git rebase --continue\")"));
@@ -1050,14 +1057,7 @@ static void show_rebase_in_progress(struct wt_status *s,
1057
_(" (use \"git rebase --abort\" to check out the original branch)"));
1058
}
1059
} else if (state->rebase_in_progress || !stat(git_path("MERGE_MSG"), &st)) {
1053
- if (state->branch)
1054
- status_printf_ln(s, color,
1055
- _("You are currently rebasing branch '%s' on '%s'."),
1056
- state->branch,
1057
- state->onto);
1058
- else
1059
- status_printf_ln(s, color,
1060
- _("You are currently rebasing."));
1060
+ print_rebase_state(s, state, color);
1061
if (s->hints)
1062
status_printf_ln(s, color,
1063
_(" (all conflicts fixed: run \"git rebase --continue\")"));