Skip to content

Commit 75135b2

Browse files
pcloudsgitster
authored andcommitted
branch: no detached HEAD check when editing another branch's description
Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7e20105 commit 75135b2

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
@@ -822,11 +822,11 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
822822
const char *branch_name;
823823
struct strbuf branch_ref = STRBUF_INIT;
824824

825-
if (detached)
826-
die("Cannot give description to detached HEAD");
827-
if (!argc)
825+
if (!argc) {
826+
if (detached)
827+
die("Cannot give description to detached HEAD");
828828
branch_name = head;
829-
else if (argc == 1)
829+
} else if (argc == 1)
830830
branch_name = argv[0];
831831
else
832832
usage_with_options(builtin_branch_usage, options);

0 commit comments

Comments
 (0)