aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2013-07-14 15:36:09 +0700
committerJunio C Hamano <gitster@pobox.com>2013-07-15 12:14:38 -0700
commit93d935371654faf2956a4c37c1ca46f3195ee832 (patch)
tree913861fd9f039c86e4f3a8b3ea1b51391d72d05d /builtin
parentbd30c2e48432c692f9e77d3529c9cf25117066bb (diff)
downloadgit-93d935371654faf2956a4c37c1ca46f3195ee832.tar.gz
git-93d935371654faf2956a4c37c1ca46f3195ee832.tar.xz
parse_pathspec: accept :(icase)path syntax
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/add.c6
-rw-r--r--builtin/ls-tree.c2
2 files changed, 5 insertions, 3 deletions
diff --git a/builtin/add.c b/builtin/add.c
index 1dab2464f..9d52fc791 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -544,12 +544,14 @@ int cmd_add(int argc, const char **argv, const char *prefix)
GUARD_PATHSPEC(&pathspec,
PATHSPEC_FROMTOP |
PATHSPEC_LITERAL |
- PATHSPEC_GLOB);
+ PATHSPEC_GLOB |
+ PATHSPEC_ICASE);
for (i = 0; i < pathspec.nr; i++) {
const char *path = pathspec.items[i].match;
if (!seen[i] &&
- ((pathspec.items[i].magic & PATHSPEC_GLOB) ||
+ ((pathspec.items[i].magic &
+ (PATHSPEC_GLOB | PATHSPEC_ICASE)) ||
!file_exists(path))) {
if (ignore_missing) {
int dtype = DT_UNKNOWN;
diff --git a/builtin/ls-tree.c b/builtin/ls-tree.c
index 7882352a9..f6d821518 100644
--- a/builtin/ls-tree.c
+++ b/builtin/ls-tree.c
@@ -173,7 +173,7 @@ int cmd_ls_tree(int argc, const char **argv, const char *prefix)
* cannot be lifted until it is converted to use
* match_pathspec_depth() or tree_entry_interesting()
*/
- parse_pathspec(&pathspec, PATHSPEC_GLOB,
+ parse_pathspec(&pathspec, PATHSPEC_GLOB | PATHSPEC_ICASE,
PATHSPEC_PREFER_CWD,
prefix, argv + 1);
for (i = 0; i < pathspec.nr; i++)