Code

Merge branch 'jk/1.7.0-status'
[git.git] / wt-status.c
index c4589055bb7d6b8e945477d09e0015fe2da349af..5d569880163cccec91fdf1e9d50e03a6b5314d58 100644 (file)
@@ -49,6 +49,8 @@ static void wt_status_print_unmerged_header(struct wt_status *s)
        const char *c = color(WT_STATUS_HEADER, s);
 
        color_fprintf_ln(s->fp, c, "# Unmerged paths:");
+       if (!advice_status_hints)
+               return;
        if (s->in_merge)
                ;
        else if (!s->is_initial)
@@ -64,6 +66,8 @@ static void wt_status_print_cached_header(struct wt_status *s)
        const char *c = color(WT_STATUS_HEADER, s);
 
        color_fprintf_ln(s->fp, c, "# Changes to be committed:");
+       if (!advice_status_hints)
+               return;
        if (s->in_merge)
                ; /* NEEDSWORK: use "git reset --unresolve"??? */
        else if (!s->is_initial)
@@ -79,6 +83,8 @@ static void wt_status_print_dirty_header(struct wt_status *s,
        const char *c = color(WT_STATUS_HEADER, s);
 
        color_fprintf_ln(s->fp, c, "# Changed but not updated:");
+       if (!advice_status_hints)
+               return;
        if (!has_deleted)
                color_fprintf_ln(s->fp, c, "#   (use \"git add <file>...\" to update what will be committed)");
        else
@@ -91,6 +97,8 @@ static void wt_status_print_untracked_header(struct wt_status *s)
 {
        const char *c = color(WT_STATUS_HEADER, s);
        color_fprintf_ln(s->fp, c, "# Untracked files:");
+       if (!advice_status_hints)
+               return;
        color_fprintf_ln(s->fp, c, "#   (use \"git add <file>...\" to include in what will be committed)");
        color_fprintf_ln(s->fp, c, "#");
 }
@@ -336,7 +344,7 @@ static void wt_status_collect_untracked(struct wt_status *s)
        setup_standard_excludes(&dir);
 
        fill_directory(&dir, NULL);
-       for(i = 0; i < dir.nr; i++) {
+       for (i = 0; i < dir.nr; i++) {
                struct dir_entry *ent = dir.entries[i];
                if (!cache_name_is_other(ent->name, ent->len))
                        continue;
@@ -569,8 +577,8 @@ void wt_status_print(struct wt_status *s)
                color_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), "#");
        }
 
-       wt_status_print_unmerged(s);
        wt_status_print_updated(s);
+       wt_status_print_unmerged(s);
        wt_status_print_changed(s);
        if (s->submodule_summary)
                wt_status_print_submodule_summary(s);