Re: [PATCH] rev-parse --show-prefix: add in trailing newline
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Apr 10, 2012, 17:36 UTC
- Message-ID
- <20120410173616.GA4300@burratino>
- In-Reply-To
- <1333978076-29968-1-git-send-email-rosslagerwall@gmail.com>
(cc-ing Duy) Hi,
Ross Lagerwall wrote:
Show 9 quoted lines
> --- a/builtin/rev-parse.c
> +++ b/builtin/rev-parse.c
> @@ -634,6 +634,8 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
> if (!strcmp(arg, "--show-prefix")) {
> if (prefix)
> puts(prefix);
> + else
> + putchar('\n');
> continue;This makes the output more consistent but it is a little puzzling how it does that. Why is prefix NULL instead of "" when we are at the toplevel of the worktree?
Thanks, Jonathan