Skip to content

Commit bf0d9d0

Browse files
committed
Merge branch 'rj/branch-do-not-exit-with-minus-one-status'
"git branch --edit-description" can exit with status -1 which is not a good practice; it learned to use 1 as everybody else instead. * rj/branch-do-not-exit-with-minus-one-status: branch: error code with --edit-description
2 parents 0c02561 + 8f24115 commit bf0d9d0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

builtin/branch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
809809

810810
strbuf_addf(&branch_ref, "refs/heads/%s", branch_name);
811811
if (!ref_exists(branch_ref.buf))
812-
ret = error((!argc || !strcmp(head, branch_name))
812+
error((!argc || !strcmp(head, branch_name))
813813
? _("No commit on branch '%s' yet.")
814814
: _("No branch named '%s'."),
815815
branch_name);

t/t3200-branch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,7 @@ test_expect_success 'branch --delete --force removes dangling branch' '
13941394

13951395
test_expect_success 'use --edit-description' '
13961396
EDITOR=: git branch --edit-description &&
1397-
test_must_fail git config branch.main.description &&
1397+
test_expect_code 1 git config branch.main.description &&
13981398
13991399
write_script editor <<-\EOF &&
14001400
echo "New contents" >"$1"

0 commit comments

Comments
 (0)