Skip to content

Commit

Permalink
git-rev-parse: flush "default" head when encountering something unexp…
Browse files Browse the repository at this point in the history
…ected

The unexpected thing is likely a pathname, we need the default for that
too.
  • Loading branch information
Linus Torvalds committed Jun 20, 2005
1 parent c591412 commit 9d73fad
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rev-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9d73fad

Please sign in to comment.