зеркало из https://github.com/microsoft/git.git
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
This commit is contained in:
Коммит
bf0d9d0d34
|
@ -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);
|
||||
|
|
|
@ -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"
|
||||
|
|
Загрузка…
Ссылка в новой задаче