diff mbox series

[v3,3/3] branch: Add an extra verbose output displaying worktree path for refs checked out in a linked worktree

Message ID 20181216215759.24011-4-nbelakovski@gmail.com (mailing list archive)
State New, archived
Headers show
Series [v3,1/3] ref-filter: add worktreepath atom | expand

Commit Message

Nickolai Belakovski Dec. 16, 2018, 9:57 p.m. UTC
From: Nickolai Belakovski <nbelakovski@gmail.com>

---
 builtin/branch.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/builtin/branch.c b/builtin/branch.c
index 2a24153b78..56589a3684 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -366,6 +366,10 @@  static char *build_format(struct ref_filter *filter, int maxwidth, const char *r
 		strbuf_addstr(&local, branch_get_color(BRANCH_COLOR_RESET));
 		strbuf_addf(&local, " %s ", obname.buf);
 
+		if (filter->verbose > 2)
+			strbuf_addf(&local, "%s%%(if:notequals=*)%%(HEAD)%%(then)%%(if)%%(worktreepath)%%(then)%%(worktreepath) %%(end)%%(end)%s",
+				    branch_get_color(BRANCH_COLOR_WORKTREE), branch_get_color(BRANCH_COLOR_RESET));
+
 		if (filter->verbose > 1)
 			strbuf_addf(&local, "%%(if)%%(upstream)%%(then)[%s%%(upstream:short)%s%%(if)%%(upstream:track)"
 				    "%%(then): %%(upstream:track,nobracket)%%(end)] %%(end)%%(contents:subject)",