summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4e0b2bb)
raw | patch | inline | side by side (parent: 4e0b2bb)
author | Junio C Hamano <gitster@pobox.com> | |
Mon, 6 Aug 2007 07:20:06 +0000 (00:20 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 6 Aug 2007 07:25:35 +0000 (00:25 -0700) |
If you have a working tree _file_ "foo", attempt to refer to a
branch "foo/bar" without -- to disambiguate, like this:
$ git log foo/bar
tried to make sure that foo/bar cannot be naming a working tree
file "foo/bar" (in which case we would say "which one do you
want? A rev or a working tree file? clarify with -- please").
We run lstat("foo/bar") to check that. If it does not succeed,
there is no ambiguity.
That is good. But we also checked the error status for the
lstat() and expected it to fail with ENOENT. In this particular
case, however, it fails with ENOTDIR. That should be treated as
"expected error" as well.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
branch "foo/bar" without -- to disambiguate, like this:
$ git log foo/bar
tried to make sure that foo/bar cannot be naming a working tree
file "foo/bar" (in which case we would say "which one do you
want? A rev or a working tree file? clarify with -- please").
We run lstat("foo/bar") to check that. If it does not succeed,
there is no ambiguity.
That is good. But we also checked the error status for the
lstat() and expected it to fail with ENOENT. In this particular
case, however, it fails with ENOTDIR. That should be treated as
"expected error" as well.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
setup.c | patch | blob | history |
index a45ea8309a9773160597f142f1208a6129885499..2b8e8c0e5e1e957615e986efaab289d77c8fc51c 100644 (file)
--- a/setup.c
+++ b/setup.c
if (!lstat(name, &st))
die("ambiguous argument '%s': both revision and filename\n"
"Use '--' to separate filenames from revisions", arg);
- if (errno != ENOENT)
+ if (errno != ENOENT && errno != ENOTDIR)
die("'%s': %s", arg, strerror(errno));
}