aboutsummaryrefslogtreecommitdiffstats
path: root/pathspec.c
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2017-05-11 15:04:26 -0700
committerJunio C Hamano <gitster@pobox.com>2017-05-12 14:23:46 +0900
commit2249d4dbc197d45da5407cbc80b2461e49bb8785 (patch)
treef70385d817d8067936ef0fcdc842be33994572ec /pathspec.c
parentcbca060e102aedcedbd1c4b5394aeed24885d5de (diff)
downloadgit-2249d4dbc197d45da5407cbc80b2461e49bb8785.tar.gz
pathspec: remove PATHSPEC_STRIP_SUBMODULE_SLASH_CHEAP
Since (ae8d08242 pathspec: pass directory indicator to match_pathspec_item()) the path matching logic has been able to cope with submodules without needing to strip off a trailing slash if a path refers to a submodule. Since stripping the slash is no longer necessary, remove the PATHSPEC_STRIP_SUBMODULE_SLASH_CHEAP flag. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pathspec.c')
-rw-r--r--pathspec.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/pathspec.c b/pathspec.c
index e424312786..1e5df2316e 100644
--- a/pathspec.c
+++ b/pathspec.c
@@ -386,18 +386,6 @@ static const char *parse_element_magic(unsigned *magic, int *prefix_len,
return parse_short_magic(magic, elem);
}
-static void strip_submodule_slash_cheap(struct pathspec_item *item)
-{
- if (item->len >= 1 && item->match[item->len - 1] == '/') {
- int i = cache_name_pos(item->match, item->len - 1);
-
- if (i >= 0 && S_ISGITLINK(active_cache[i]->ce_mode)) {
- item->len--;
- item->match[item->len] = '\0';
- }
- }
-}
-
/*
* Perform the initialization of a pathspec_item based on a pathspec element.
*/
@@ -470,9 +458,6 @@ static void init_pathspec_item(struct pathspec_item *item, unsigned flags,
item->original = xstrdup(elt);
}
- if (flags & PATHSPEC_STRIP_SUBMODULE_SLASH_CHEAP)
- strip_submodule_slash_cheap(item);
-
if (magic & PATHSPEC_LITERAL) {
item->nowildcard_len = item->len;
} else {