diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2016-11-28 16:36:53 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-11-28 13:18:51 -0800 |
commit | 96f09e2a1100d78aacad80a741c3046031fda6b4 (patch) | |
tree | 21e48f8059fac4c0f8518ffc1e9aff4a0acad53f /builtin/worktree.c | |
parent | f054996d8370c3213f8c8cbde908545ba6c0f854 (diff) | |
download | git-96f09e2a1100d78aacad80a741c3046031fda6b4.tar.gz git-96f09e2a1100d78aacad80a741c3046031fda6b4.tar.xz |
worktree: reorder an if statement
This is no-op. But it helps reduce diff noise in the next patch.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/worktree.c')
-rw-r--r-- | builtin/worktree.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/worktree.c b/builtin/worktree.c index 5c4854d3e..8a654e4ad 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); |