summaryrefslogtreecommitdiff
path: root/pathspec.c
diff options
context:
space:
mode:
Diffstat (limited to 'pathspec.c')
-rw-r--r--pathspec.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/pathspec.c b/pathspec.c
index 6d99a3dced..06778fc756 100644
--- a/pathspec.c
+++ b/pathspec.c
@@ -267,6 +267,9 @@ void parse_pathspec(struct pathspec *pathspec,
memset(pathspec, 0, sizeof(*pathspec));
+ if (flags & PATHSPEC_MAXDEPTH_VALID)
+ pathspec->magic |= PATHSPEC_MAXDEPTH;
+
/* No arguments, no prefix -> no pathspec */
if (!entry && !prefix)
return;
@@ -322,8 +325,9 @@ void parse_pathspec(struct pathspec *pathspec,
pathspec->magic |= item[i].magic;
}
- qsort(pathspec->items, pathspec->nr,
- sizeof(struct pathspec_item), pathspec_item_cmp);
+ if (pathspec->magic & PATHSPEC_MAXDEPTH)
+ qsort(pathspec->items, pathspec->nr,
+ sizeof(struct pathspec_item), pathspec_item_cmp);
}
/*