diff options
author | Linus Torvalds <torvalds@osdl.org> | 2006-04-26 10:15:54 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-04-26 12:16:21 -0700 |
commit | e23d0b4a4a55cc07e133905f0e9526b3550dd61b (patch) | |
tree | 515672854c5dd676564edf9d73792129d62f9ecc /revision.c | |
parent | b176e6ba5bc37466ffcb6c8c0f38c47ec6e9e73a (diff) | |
download | git-e23d0b4a4a55cc07e133905f0e9526b3550dd61b.tar.gz git-e23d0b4a4a55cc07e133905f0e9526b3550dd61b.tar.xz |
Fix filename verification when in a subdirectory
When we are in a subdirectory of a git archive, we need to take the prefix
of that subdirectory into accoung when we verify filename arguments.
Noted by Matthias Lederhofer
This also uses the improved error reporting for all the other git commands
that use the revision parsing interfaces, not just git-rev-parse. Also, it
makes the error reporting for mixed filenames and argument flags clearer
(you cannot put flags after the start of the pathname list).
[jc: with fix to a trivial typo noticed by Timo Hirvonen]
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'revision.c')
-rw-r--r-- | revision.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/revision.c b/revision.c index e1f9816bd..03dd23893 100644 --- a/revision.c +++ b/revision.c @@ -675,17 +675,15 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch arg++; } if (get_sha1(arg, sha1) < 0) { - struct stat st; int j; if (seen_dashdash || local_flags) die("bad revision '%s'", arg); /* If we didn't have a "--", all filenames must exist */ - for (j = i; j < argc; j++) { - if (lstat(argv[j], &st) < 0) - die("'%s': %s", argv[j], strerror(errno)); - } + for (j = i; j < argc; j++) + verify_filename(revs->prefix, argv[j]); + revs->prune_data = get_pathspec(revs->prefix, argv + i); break; } |