From: Linus Torvalds Date: Mon, 20 Jun 2005 23:14:13 +0000 (-0700) Subject: git-rev-parse: flush "default" head when encountering something unexpected X-Git-Tag: v0.99~230 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9d73fad4ca15bc0fffe34ee66aea5b9691ab3d2f;p=git.git git-rev-parse: flush "default" head when encountering something unexpected The unexpected thing is likely a pathname, we need the default for that too. --- diff --git a/rev-parse.c b/rev-parse.c index 1f4f3240d..7419d18b3 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)