convert unmerge_cache to take struct pathspec

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Nguyễn Thái Ngọc Duy committed Jul 14, 2013 at 15:35 UTC 5ab06518a71a8bd128a2aea38ddb537870d3ea2b
3 files changed +4 -4
rerere.c
+1 -1
@@ -668,7 +668,7 @@ int rerere_forget(struct pathspec *pathspec)
668
669 fd = setup_rerere(&merge_rr, RERERE_NOAUTOUPDATE);
670
671 - unmerge_cache(pathspec->raw);
671 + unmerge_cache(pathspec);
672 find_conflict(&conflict);
673 for (i = 0; i < conflict.nr; i++) {
674 struct string_list_item *it = &conflict.items[i];
resolve-undo.c
+2 -2
@@ -173,7 +173,7 @@ void unmerge_marked_index(struct index_state *istate)
173 }
174 }
175
176 -void unmerge_index(struct index_state *istate, const char **pathspec)
176 +void unmerge_index(struct index_state *istate, const struct pathspec *pathspec)
177 {
178 int i;
179
@@ -182,7 +182,7 @@ void unmerge_index(struct index_state *istate, const char **pathspec)
182
183 for (i = 0; i < istate->cache_nr; i++) {
184 struct cache_entry *ce = istate->cache[i];
185 - if (!match_pathspec(pathspec, ce->name, ce_namelen(ce), 0, NULL))
185 + if (!match_pathspec_depth(pathspec, ce->name, ce_namelen(ce), 0, NULL))
186 continue;
187 i = unmerge_index_entry_at(istate, i);
188 }
resolve-undo.h
+1 -1
@@ -11,7 +11,7 @@ extern void resolve_undo_write(struct strbuf *, struct string_list *);
11 extern struct string_list *resolve_undo_read(const char *, unsigned long);
12 extern void resolve_undo_clear_index(struct index_state *);
13 extern int unmerge_index_entry_at(struct index_state *, int);
14 -extern void unmerge_index(struct index_state *, const char **);
14 +extern void unmerge_index(struct index_state *, const struct pathspec *);
15 extern void unmerge_marked_index(struct index_state *);
16
17 #endif