author | Linus Torvalds <torvalds@osdl.org> | |
Mon, 27 Mar 2006 00:28:20 +0000 (16:28 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 27 Mar 2006 03:06:17 +0000 (19:06 -0800) | ||
commit | fb18a2edf7f3d1585b6330b7dde110b992d3b97c | |
tree | da2f0dfbeba9118205ab90ae6057952e0dae32c8 | tree | snapshot |
parent | be1295d16a2593dcf468fef7d9e811d057d9039f | commit | diff |
Fix error handling for nonexistent names
When passing in a pathname pattern without the "--" separator on the
command line, we verify that the pathnames in question exist. However,
there were two bugs in that verification:
- git-rev-parse would only check the first pathname, and silently allow
any invalid subsequent pathname, whether it existed or not (which
defeats the purpose of the check, and is also inconsistent with what
git-rev-list actually does)
- git-rev-list (and "git log" etc) would check each filename, but if the
check failed, it would print the error using the first one, i.e.:
[torvalds@g5 git]$ git log Makefile bad-file
fatal: 'Makefile': No such file or directory
instead of saying that it's 'bad-file' that doesn't exist.
This fixes both bugs.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
When passing in a pathname pattern without the "--" separator on the
command line, we verify that the pathnames in question exist. However,
there were two bugs in that verification:
- git-rev-parse would only check the first pathname, and silently allow
any invalid subsequent pathname, whether it existed or not (which
defeats the purpose of the check, and is also inconsistent with what
git-rev-list actually does)
- git-rev-list (and "git log" etc) would check each filename, but if the
check failed, it would print the error using the first one, i.e.:
[torvalds@g5 git]$ git log Makefile bad-file
fatal: 'Makefile': No such file or directory
instead of saying that it's 'bad-file' that doesn't exist.
This fixes both bugs.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
rev-parse.c | diff | blob | history | |
revision.c | diff | blob | history |