diff options
Diffstat (limited to 'pathspec.c')
-rw-r--r-- | pathspec.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/pathspec.c b/pathspec.c index 6cb9fd3014..9304ee33d7 100644 --- a/pathspec.c +++ b/pathspec.c @@ -33,7 +33,7 @@ void add_pathspec_matches_against_index(const struct pathspec *pathspec, return; for (i = 0; i < active_nr; i++) { const struct cache_entry *ce = active_cache[i]; - match_pathspec_depth(pathspec, ce->name, ce_namelen(ce), 0, seen); + ce_path_match(ce, pathspec, seen); } } @@ -338,7 +338,7 @@ static void NORETURN unsupported_magic(const char *pattern, if (!(magic & m->bit)) continue; if (sb.len) - strbuf_addstr(&sb, " "); + strbuf_addch(&sb, ' '); if (short_magic & m->bit) strbuf_addf(&sb, "'%c'", m->mnemonic); else @@ -389,8 +389,7 @@ void parse_pathspec(struct pathspec *pathspec, if (!(flags & PATHSPEC_PREFER_CWD)) die("BUG: PATHSPEC_PREFER_CWD requires arguments"); - pathspec->items = item = xmalloc(sizeof(*item)); - memset(item, 0, sizeof(*item)); + pathspec->items = item = xcalloc(1, sizeof(*item)); item->match = prefix; item->original = prefix; item->nowildcard_len = item->len = strlen(prefix); |