Skip to content

Commit 96f09e2

Browse files
pcloudsgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f054996 commit 96f09e2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

builtin/worktree.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,10 @@ static void show_worktree(struct worktree *wt, int path_maxlen, int abbrev_len)
406406
else {
407407
strbuf_addf(&sb, "%-*s ", abbrev_len,
408408
find_unique_abbrev(wt->head_sha1, DEFAULT_ABBREV));
409-
if (!wt->is_detached)
410-
strbuf_addf(&sb, "[%s]", shorten_unambiguous_ref(wt->head_ref, 0));
411-
else
409+
if (wt->is_detached)
412410
strbuf_addstr(&sb, "(detached HEAD)");
411+
else
412+
strbuf_addf(&sb, "[%s]", shorten_unambiguous_ref(wt->head_ref, 0));
413413
}
414414
printf("%s\n", sb.buf);
415415

0 commit comments

Comments
 (0)