Code

grep: read patterns from stdin with -f -
[git.git] / wt-status.c
index 1ea330ed17c921c521543534917c7ec863e42319..4daa8bb5242fc689973839a13a3a28477efbb6bf 100644 (file)
@@ -60,7 +60,7 @@ static void wt_status_print_unmerged_header(struct wt_status *s)
        color_fprintf_ln(s->fp, c, "# Unmerged paths:");
        if (!advice_status_hints)
                return;
-       if (s->in_merge)
+       if (s->whence != FROM_COMMIT)
                ;
        else if (!s->is_initial)
                color_fprintf_ln(s->fp, c, "#   (use \"git reset %s <file>...\" to unstage)", s->reference);
@@ -77,7 +77,7 @@ static void wt_status_print_cached_header(struct wt_status *s)
        color_fprintf_ln(s->fp, c, "# Changes to be committed:");
        if (!advice_status_hints)
                return;
-       if (s->in_merge)
+       if (s->whence != FROM_COMMIT)
                ; /* NEEDSWORK: use "git reset --unresolve"??? */
        else if (!s->is_initial)
                color_fprintf_ln(s->fp, c, "#   (use \"git reset %s <file>...\" to unstage)", s->reference);
@@ -354,14 +354,16 @@ static void wt_status_collect_changes_index(struct wt_status *s)
 
 static void wt_status_collect_changes_initial(struct wt_status *s)
 {
+       struct pathspec pathspec;
        int i;
 
+       init_pathspec(&pathspec, s->pathspec);
        for (i = 0; i < active_nr; i++) {
                struct string_list_item *it;
                struct wt_status_change_data *d;
                struct cache_entry *ce = active_cache[i];
 
-               if (!ce_path_match(ce, s->pathspec))
+               if (!ce_path_match(ce, &pathspec))
                        continue;
                it = string_list_insert(&s->change, ce->name);
                d = it->util;
@@ -376,6 +378,7 @@ static void wt_status_collect_changes_initial(struct wt_status *s)
                else
                        d->index_status = DIFF_STATUS_ADDED;
        }
+       free_pathspec(&pathspec);
 }
 
 static void wt_status_collect_untracked(struct wt_status *s)