Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2022-10-31 04:04:43 +0300
committerTaylor Blau <me@ttaylorr.com>2022-10-31 04:04:43 +0300
commitbf0d9d0d347ddee86d4e848c70584666d384f026 (patch)
tree61b32f55648341cd615215475c44ed00b0759ea2
parent0c025612d4f53c0802d931fa75619d9494755ffb (diff)
parent8f241151656053e3ae130e9e0025b9cf71ccc3ce (diff)
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
-rw-r--r--builtin/branch.c2
-rwxr-xr-xt/t3200-branch.sh2
2 files changed, 2 insertions, 2 deletions
diff --git a/builtin/branch.c b/builtin/branch.c
index c964ac7bb42..15be0c03ef2 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -809,7 +809,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
strbuf_addf(&branch_ref, "refs/heads/%s", branch_name);
if (!ref_exists(branch_ref.buf))
- ret = error((!argc || !strcmp(head, branch_name))
+ error((!argc || !strcmp(head, branch_name))
? _("No commit on branch '%s' yet.")
: _("No branch named '%s'."),
branch_name);
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index 38c57de71ba..7f605f865b3 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -1394,7 +1394,7 @@ test_expect_success 'branch --delete --force removes dangling branch' '
test_expect_success 'use --edit-description' '
EDITOR=: git branch --edit-description &&
- test_must_fail git config branch.main.description &&
+ test_expect_code 1 git config branch.main.description &&
write_script editor <<-\EOF &&
echo "New contents" >"$1"