summaryrefslogtreecommitdiff
path: root/pathspec.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-09-09 14:50:42 -0700
committerJunio C Hamano <gitster@pobox.com>2013-09-09 14:50:44 -0700
commitfadf96abaa5f42c4bb7b4b5017926779c23d8ef3 (patch)
treec2999c9aafd8071d01cabfd16d152cd20e437e11 /pathspec.c
parentaf226bf01e99043f5f3d8bc09ad302d17e0de757 (diff)
parent625c3304e200f9bdc05626be1397311faa4962ba (diff)
downloadgit-fadf96abaa5f42c4bb7b4b5017926779c23d8ef3.tar.gz
Merge branch 'nd/magic-pathspec'
Use "struct pathspec" interface in more places, instead of array of characters, the latter of which cannot express magic pathspecs (e.g. ":(icase)makefile" that matches both Makefile and makefile). * nd/magic-pathspec: add: lift the pathspec magic restriction on "add -p" pathspec: catch prepending :(prefix) on pathspec with short magic
Diffstat (limited to 'pathspec.c')
-rw-r--r--pathspec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pathspec.c b/pathspec.c
index 4b32cc32cb..ad1a9f5b28 100644
--- a/pathspec.c
+++ b/pathspec.c
@@ -231,7 +231,9 @@ static unsigned prefix_pathspec(struct pathspec_item *item,
const char *start = elt;
if (prefixlen && !literal_global) {
/* Preserve the actual prefix length of each pattern */
- if (long_magic_end) {
+ if (short_magic)
+ die("BUG: prefixing on short magic is not supported");
+ else if (long_magic_end) {
strbuf_add(&sb, start, long_magic_end - start);
strbuf_addf(&sb, ",prefix:%d", prefixlen);
start = long_magic_end;