From 96f09e2a1100d78aacad80a741c3046031fda6b4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Mon, 28 Nov 2016 16:36:53 +0700 Subject: [PATCH] worktree: reorder an if statement MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This is no-op. But it helps reduce diff noise in the next patch. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- builtin/worktree.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin/worktree.c b/builtin/worktree.c index 5c4854d3e4..8a654e4ad3 100644 --- a/builtin/worktree.c +++ b/builtin/worktree.c @@ -406,10 +406,10 @@ static void show_worktree(struct worktree *wt, int path_maxlen, int abbrev_len) else { strbuf_addf(&sb, "%-*s ", abbrev_len, find_unique_abbrev(wt->head_sha1, DEFAULT_ABBREV)); - if (!wt->is_detached) - strbuf_addf(&sb, "[%s]", shorten_unambiguous_ref(wt->head_ref, 0)); - else + if (wt->is_detached) strbuf_addstr(&sb, "(detached HEAD)"); + else + strbuf_addf(&sb, "[%s]", shorten_unambiguous_ref(wt->head_ref, 0)); } printf("%s\n", sb.buf); -- 2.47.1