wt-status.c: move has_unmerged earlier in the file
authorStephen P. Smith <ischis2@cox.net>
Thu, 6 Sep 2018 00:53:26 +0000 (17:53 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 7 Sep 2018 21:36:32 +0000 (14:36 -0700)
Move has_unmerged() up in the file so that it can be called in
wt_status_collect() where we need to place a merge check.

Signed-off-by: Stephen P. Smith <ischis2@cox.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
wt-status.c
index 5ffab61015da908ed36b7ca6455f53fd42f1e292..180faf6ba7d5db31f774e62500e624e189ccc9fb 100644 (file)
@@ -724,6 +724,19 @@ static void wt_status_collect_untracked(struct wt_status *s)
                s->untracked_in_ms = (getnanotime() - t_begin) / 1000000;
 }
 
                s->untracked_in_ms = (getnanotime() - t_begin) / 1000000;
 }
 
+static int has_unmerged(struct wt_status *s)
+{
+       int i;
+
+       for (i = 0; i < s->change.nr; i++) {
+               struct wt_status_change_data *d;
+               d = s->change.items[i].util;
+               if (d->stagemask)
+                       return 1;
+       }
+       return 0;
+}
+
 void wt_status_collect(struct wt_status *s)
 {
        wt_status_collect_changes_worktree(s);
 void wt_status_collect(struct wt_status *s)
 {
        wt_status_collect_changes_worktree(s);
@@ -1063,19 +1076,6 @@ static void wt_longstatus_print_tracking(struct wt_status *s)
        strbuf_release(&sb);
 }
 
        strbuf_release(&sb);
 }
 
-static int has_unmerged(struct wt_status *s)
-{
-       int i;
-
-       for (i = 0; i < s->change.nr; i++) {
-               struct wt_status_change_data *d;
-               d = s->change.items[i].util;
-               if (d->stagemask)
-                       return 1;
-       }
-       return 0;
-}
-
 static void show_merge_in_progress(struct wt_status *s,
                                struct wt_status_state *state,
                                const char *color)
 static void show_merge_in_progress(struct wt_status *s,
                                struct wt_status_state *state,
                                const char *color)