From: Guillaume Pagès <guillaume.pa...@ensimag.grenoble-inp.fr>

Signed-off-by: Guillaume Pagès <guillaume.pa...@ensimag.grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gits...@pobox.com>
Signed-off-by: Matthieu Moy <matthieu....@imag.fr>
---
 wt-status.c | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/wt-status.c b/wt-status.c
index eaed4fe..8c4b806 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -1027,6 +1027,20 @@ 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)
@@ -1034,14 +1048,7 @@ static void show_rebase_in_progress(struct wt_status *s,
        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\")"));
@@ -1051,14 +1058,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\")"));
-- 
2.5.0.rc0.7.ge1edd74.dirty

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to