Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-21 03:14:13 +0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-21 03:14:13 +0400
commit9d73fad4ca15bc0fffe34ee66aea5b9691ab3d2f (patch)
tree77e6233101f5f43819b9231cb474a56440d15747 /rev-parse.c
parentc591412cc0aaf10890cdda4cf97a4fbc782d7d49 (diff)
git-rev-parse: flush "default" head when encountering something unexpected
The unexpected thing is likely a pathname, we need the default for that too.
Diffstat (limited to 'rev-parse.c')
-rw-r--r--rev-parse.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/rev-parse.c b/rev-parse.c
index 1f4f3240de..7419d18b3b 100644
--- a/rev-parse.c
+++ b/rev-parse.c
@@ -111,9 +111,12 @@ int main(int argc, char **argv)
printf("^%s\n", sha1_to_hex(sha1));
continue;
}
+ if (def) {
+ printf("%s\n", def);
+ def = NULL;
+ }
if (revs_only)
continue;
- def = NULL;
printf("%s\n", arg);
}
if (def)