diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2012-11-24 11:33:49 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-11-26 11:12:51 -0800 |
commit | 5d74762d87859d08fdf4c87ec9387e31e097acba (patch) | |
tree | 7bb2c2522a33fe0aef56d35666b6a1a8cd13c8fd /tree-walk.c | |
parent | pathspec: save the non-wildcard length part (diff) | |
download | tgif-5d74762d87859d08fdf4c87ec9387e31e097acba.tar.xz |
pathspec: do exact comparison on the leading non-wildcard part
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'tree-walk.c')
-rw-r--r-- | tree-walk.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tree-walk.c b/tree-walk.c index af871c50d1..2fcf3c02da 100644 --- a/tree-walk.c +++ b/tree-walk.c @@ -627,7 +627,8 @@ enum interesting tree_entry_interesting(const struct name_entry *entry, return entry_interesting; if (item->nowildcard_len < item->len) { - if (!fnmatch(match + baselen, entry->path, 0)) + if (!git_fnmatch(match + baselen, entry->path, + 0, item->nowildcard_len - baselen)) return entry_interesting; /* @@ -652,7 +653,8 @@ match_wildcards: strbuf_add(base, entry->path, pathlen); - if (!fnmatch(match, base->buf + base_offset, 0)) { + if (!git_fnmatch(match, base->buf + base_offset, + 0, item->nowildcard_len)) { strbuf_setlen(base, base_offset + baselen); return entry_interesting; } |