Skip to content

Commit 5ab0651

Browse files
pcloudsgitster
authored andcommitted
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>
1 parent 480ca64 commit 5ab0651

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

rerere.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ int rerere_forget(struct pathspec *pathspec)
668668

669669
fd = setup_rerere(&merge_rr, RERERE_NOAUTOUPDATE);
670670

671-
unmerge_cache(pathspec->raw);
671+
unmerge_cache(pathspec);
672672
find_conflict(&conflict);
673673
for (i = 0; i < conflict.nr; i++) {
674674
struct string_list_item *it = &conflict.items[i];

resolve-undo.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ void unmerge_marked_index(struct index_state *istate)
173173
}
174174
}
175175

176-
void unmerge_index(struct index_state *istate, const char **pathspec)
176+
void unmerge_index(struct index_state *istate, const struct pathspec *pathspec)
177177
{
178178
int i;
179179

@@ -182,7 +182,7 @@ void unmerge_index(struct index_state *istate, const char **pathspec)
182182

183183
for (i = 0; i < istate->cache_nr; i++) {
184184
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))
186186
continue;
187187
i = unmerge_index_entry_at(istate, i);
188188
}

resolve-undo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ extern void resolve_undo_write(struct strbuf *, struct string_list *);
1111
extern struct string_list *resolve_undo_read(const char *, unsigned long);
1212
extern void resolve_undo_clear_index(struct index_state *);
1313
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 *);
1515
extern void unmerge_marked_index(struct index_state *);
1616

1717
#endif

0 commit comments

Comments
 (0)