Skip to content

Commit d3c0f77

Browse files
committed
Merge branch 'nd/edit-branch-desc-while-detached'
Attempt to "branch --edit-description" an existing branch, while being on a detached HEAD, errored out. * nd/edit-branch-desc-while-detached: branch: no detached HEAD check when editing another branch's description
2 parents 4acfff9 + 75135b2 commit d3c0f77

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
@@ -850,11 +850,11 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
850850
const char *branch_name;
851851
struct strbuf branch_ref = STRBUF_INIT;
852852

853-
if (detached)
854-
die("Cannot give description to detached HEAD");
855-
if (!argc)
853+
if (!argc) {
854+
if (detached)
855+
die("Cannot give description to detached HEAD");
856856
branch_name = head;
857-
else if (argc == 1)
857+
} else if (argc == 1)
858858
branch_name = argv[0];
859859
else
860860
usage_with_options(builtin_branch_usage, options);

0 commit comments

Comments
 (0)