path: root/builtin
diff options
authorJunio C Hamano <>2011-05-23 16:58:35 (GMT)
committerJunio C Hamano <>2011-05-23 16:58:35 (GMT)
commitbe5ab43566a7f9ea663349dbb9d7e83e270b3396 (patch)
treecc2d48f22dcfe9969c7ab2be2a6fbf596431347b /builtin
parentb7aba2ef3450832828148e1a71b6a7198614b43d (diff)
parent488201c87e284ae06323b534c31e354811fb0d51 (diff)
Merge branch 'jc/magic-pathspec'
* jc/magic-pathspec: setup.c: Fix some "symbol not declared" sparse warnings t3703: Skip tests using directory name ":" on Windows revision.c: leave a note for "a lone :" enhancement t3703, t4208: add test cases for magic pathspec rev/path disambiguation: further restrict "misspelled index entry" diag fix overslow :/no-such-string-ever-existed diagnostics fix overstrict :<path> diagnosis grep: use get_pathspec() correctly pathspec: drop "lone : means no pathspec" from get_pathspec() Revert "magic pathspec: add ":(icase)path" to match case insensitively" magic pathspec: add ":(icase)path" to match case insensitively magic pathspec: futureproof shorthand form magic pathspec: add tentative ":/path/from/top/level" pathspec support
Diffstat (limited to 'builtin')
1 files changed, 1 insertions, 7 deletions
diff --git a/builtin/grep.c b/builtin/grep.c
index 3ee2ec5..931eee0 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -969,13 +969,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
verify_filename(prefix, argv[j]);
- if (i < argc)
- paths = get_pathspec(prefix, argv + i);
- else if (prefix) {
- paths = xcalloc(2, sizeof(const char *));
- paths[0] = prefix;
- paths[1] = NULL;
- }
+ paths = get_pathspec(prefix, argv + i);
init_pathspec(&pathspec, paths);
pathspec.max_depth = opt.max_depth;
pathspec.recursive = 1;