Skip to content

Commit 35484d4

Browse files
committed
Merge branch 'nd/edit-branch-desc-while-detached' into HEAD
* nd/edit-branch-desc-while-detached: branch: no detached HEAD check when editing another branch's description
2 parents 43722c4 + 75135b2 commit 35484d4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

builtin/branch.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -852,11 +852,11 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
852852
const char *branch_name;
853853
struct strbuf branch_ref = STRBUF_INIT;
854854

855-
if (detached)
856-
die("Cannot give description to detached HEAD");
857-
if (!argc)
855+
if (!argc) {
856+
if (detached)
857+
die("Cannot give description to detached HEAD");
858858
branch_name = head;
859-
else if (argc == 1)
859+
} else if (argc == 1)
860860
branch_name = argv[0];
861861
else
862862
die(_("cannot edit description of more than one branch"));

0 commit comments

Comments
 (0)