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
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user