diff options
author | Nickolai Belakovski <nbelakovski@gmail.com> | 2019-04-28 22:19:44 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-05-07 13:45:55 +0900 |
commit | 6e9381469e3bd866e73affe6d9d96206ee7ff965 (patch) | |
tree | d24a25b1472db7119a46864b4834cc0e6934266a /builtin/branch.c | |
parent | branch: update output to include worktree info (diff) | |
download | tgif-6e9381469e3bd866e73affe6d9d96206ee7ff965.tar.xz |
branch: add worktree info on verbose output
To display worktree path for refs checked out in a linked worktree
Signed-off-by: Nickolai Belakovski <nbelakovski@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/branch.c')
-rw-r--r-- | builtin/branch.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/branch.c b/builtin/branch.c index 350b039063..3d1872babc 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -367,9 +367,13 @@ static char *build_format(struct ref_filter *filter, int maxwidth, const char *r strbuf_addf(&local, " %s ", obname.buf); if (filter->verbose > 1) + { + strbuf_addf(&local, "%%(if:notequals=*)%%(HEAD)%%(then)%%(if)%%(worktreepath)%%(then)(%s%%(worktreepath)%s) %%(end)%%(end)", + branch_get_color(BRANCH_COLOR_WORKTREE), branch_get_color(BRANCH_COLOR_RESET)); strbuf_addf(&local, "%%(if)%%(upstream)%%(then)[%s%%(upstream:short)%s%%(if)%%(upstream:track)" "%%(then): %%(upstream:track,nobracket)%%(end)] %%(end)%%(contents:subject)", branch_get_color(BRANCH_COLOR_UPSTREAM), branch_get_color(BRANCH_COLOR_RESET)); + } else strbuf_addf(&local, "%%(if)%%(upstream:track)%%(then)%%(upstream:track) %%(end)%%(contents:subject)"); |