summaryrefslogtreecommitdiff
path: root/rev-parse.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@osdl.org>2005-10-21 00:16:30 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-10-21 05:32:07 (GMT)
commita08b6505942c3c7137f8fb7516a2d5bc54153997 (patch)
treebc8e090e87216e83ecd05d7f7716efe79f430614 /rev-parse.c
parentadc3dbca1aed4e8b25dd9b77463bbe87f7e86b94 (diff)
downloadgit-a08b6505942c3c7137f8fb7516a2d5bc54153997.zip
git-a08b6505942c3c7137f8fb7516a2d5bc54153997.tar.gz
git-a08b6505942c3c7137f8fb7516a2d5bc54153997.tar.bz2
git-rev-parse: pass on "--" flag when required
If rev-parse output includes both flags and files, we should pass on any "--" marker we see, so that the end result can also tell the difference between a flag and a filename that begins with '-'. [jc: merged a later one liner updates from Linus] Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'rev-parse.c')
-rw-r--r--rev-parse.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/rev-parse.c b/rev-parse.c
index 85230df..243f89f 100644
--- a/rev-parse.c
+++ b/rev-parse.c
@@ -174,6 +174,10 @@ int main(int argc, char **argv)
if (*arg == '-') {
if (!strcmp(arg, "--")) {
as_is = 1;
+ show_default();
+ /* Pass on the "--" if we show anything but files.. */
+ if (filter & (DO_FLAGS | DO_REVS))
+ show_file(arg);
continue;
}
if (!strcmp(arg, "--default")) {