summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2718435)
raw | patch | inline | side by side (parent: 2718435)
author | Linus Torvalds <torvalds@osdl.org> | |
Mon, 6 Feb 2006 05:41:47 +0000 (21:41 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 6 Feb 2006 05:49:42 +0000 (21:49 -0800) |
Earlier we had a workaround to avoid misspelled revision name to
be taken as a filename when "--no-revs --no-flags" are in
effect. This cleans up the logic.
Signed-off-by: Junio C Hamano <junkio@cox.net>
be taken as a filename when "--no-revs --no-flags" are in
effect. This cleans up the logic.
Signed-off-by: Junio C Hamano <junkio@cox.net>
rev-parse.c | patch | blob | history |
diff --git a/rev-parse.c b/rev-parse.c
index 9cec33b8c00c322d6acde3e588a5c1dfe53f948d..b82f294a78994e512c4f30da5bb4ba3eca3f95b4 100644 (file)
--- a/rev-parse.c
+++ b/rev-parse.c
show(buffer);
}
-static void show_file(const char *arg)
+static int show_file(const char *arg)
{
show_default();
- if ((filter & (DO_NONFLAGS|DO_NOREV)) == (DO_NONFLAGS|DO_NOREV))
+ if ((filter & (DO_NONFLAGS|DO_NOREV)) == (DO_NONFLAGS|DO_NOREV)) {
show(arg);
+ return 1;
+ }
+ return 0;
}
int main(int argc, char **argv)
show_rev(REVERSED, sha1, arg+1);
continue;
}
+ as_is = 1;
+ if (!show_file(arg))
+ continue;
if (verify)
die("Needed a single revision");
- if ((filter & DO_REVS) &&
- (filter & DO_NONFLAGS) && /* !def && */
- lstat(arg, &st) < 0)
+ if (lstat(arg, &st) < 0)
die("'%s': %s", arg, strerror(errno));
- as_is = 1;
- show_file(arg);
}
show_default();
if (verify && revs_count != 1)