Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-01-30 20:52:53 +0400
committerJunio C Hamano <gitster@pobox.com>2013-01-30 20:52:53 +0400
commit7b5196909c7773a3ce6d3cd0ba78f42249bf27c3 (patch)
tree643b5ad7f520dd456d35ab0e7e86c69da665ce7c /builtin
parentb596574ed30a9353fabc55c4548e80c4df4d009e (diff)
parent0b0ecaac2ad984599923999d6d4c32e6111bb73f (diff)
Merge branch 'nd/magic-pathspec-from-root'
When giving arguments without "--" disambiguation, object names that come earlier on the command line must not be interpretable as pathspecs and pathspecs that come later on the command line must not be interpretable as object names. Tweak the disambiguation rule so that ":/" (no other string before or after) is always interpreted as a pathspec, to avoid having to say "git cmd -- :/". * nd/magic-pathspec-from-root: grep: avoid accepting ambiguous revision Update :/abc ambiguity check
Diffstat (limited to 'builtin')
-rw-r--r--builtin/grep.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/grep.c b/builtin/grep.c
index 0e1b6c860e..8025964987 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -823,6 +823,8 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
struct object *object = parse_object(sha1);
if (!object)
die(_("bad object %s"), arg);
+ if (!seen_dashdash)
+ verify_non_filename(prefix, arg);
add_object_array(object, arg, &list);
continue;
}