check-ignore: convert to use parse_pathspec
check-ignore (at least the test suite) seems to rely on the pattern order. PATHSPEC_KEEP_ORDER is introduced to explictly express this. The lack of PATHSPEC_MAXDEPTH_VALID is sufficient because it's the only flag that reorders pathspecs, but it's less obvious that way. Cc: Adam Spiers <git@adamspiers.org> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
f3e743a0d9
commit
931eab64ad
@ -370,9 +370,13 @@ void parse_pathspec(struct pathspec *pathspec,
|
||||
pathspec->magic |= item[i].magic;
|
||||
}
|
||||
|
||||
if (pathspec->magic & PATHSPEC_MAXDEPTH)
|
||||
|
||||
if (pathspec->magic & PATHSPEC_MAXDEPTH) {
|
||||
if (flags & PATHSPEC_KEEP_ORDER)
|
||||
die("BUG: PATHSPEC_MAXDEPTH_VALID and PATHSPEC_KEEP_ORDER are incompatible");
|
||||
qsort(pathspec->items, pathspec->nr,
|
||||
sizeof(struct pathspec_item), pathspec_item_cmp);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user