Browse Source

git-rev-parse: flush "default" head when encountering something unexpected

The unexpected thing is likely a pathname, we need the default for that
too.
maint
Linus Torvalds 20 years ago
parent
commit
9d73fad4ca
  1. 5
      rev-parse.c

5
rev-parse.c

@ -111,9 +111,12 @@ int main(int argc, char **argv) @@ -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)

Loading…
Cancel
Save