summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7c5f3cc)
raw | patch | inline | side by side (parent: 7c5f3cc)
author | Junio C Hamano <gitster@pobox.com> | |
Tue, 10 May 2011 18:10:30 +0000 (11:10 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 10 May 2011 19:36:06 +0000 (12:36 -0700) |
Given "git log :", we get a disambiguation message that tries to be
helpful and yet totally misses the point, i.e.
$ git log :
fatal: Path '' does not exist (neither on disk nor in the index).
$ git log :/
fatal: Path '/' exists on disk, but not in the index.
An empty path nor anything that begins with '/' cannot possibly in the
index, and it is wrong to guess that the user might have meant to access
such an index entry.
It should yield the same error message as "git log '*.c'", i.e.
$ git log '*.c'
fatal: ambiguous argument '*.c': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
Signed-off-by: Junio C Hamano <gitster@pobox.com>
helpful and yet totally misses the point, i.e.
$ git log :
fatal: Path '' does not exist (neither on disk nor in the index).
$ git log :/
fatal: Path '/' exists on disk, but not in the index.
An empty path nor anything that begins with '/' cannot possibly in the
index, and it is wrong to guess that the user might have meant to access
such an index entry.
It should yield the same error message as "git log '*.c'", i.e.
$ git log '*.c'
fatal: ambiguous argument '*.c': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1_name.c | patch | blob | history |
diff --git a/sha1_name.c b/sha1_name.c
index faea58dc8c27de23e8fbaff17b39cb9e57708510..90d8bfa20a153a97dcb3f7a974d9b4b457c02f79 100644 (file)
--- a/sha1_name.c
+++ b/sha1_name.c
}
pos++;
}
- if (!gently)
+ if (!gently && name[1] && name[1] != '/')
diagnose_invalid_index_path(stage, prefix, cp);
free(new_path);
return -1;