Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'jm/branch-rename-nothing-error'

"git branch -m" without any argument noticed an error, but with an
incorrect error message.

* jm/branch-rename-nothing-error:
  branch: give better message when no names specified for rename
  • Loading branch information...
commit 8054b9a6153dffca012efe609ffa18004e8251e5 2 parents ed23f31 + d1520c4
@gitster gitster authored
Showing with 4 additions and 2 deletions.
  1. +3 −1 builtin/branch.c
  2. +1 −1  t/t3200-branch.sh
View
4 builtin/branch.c
@@ -904,7 +904,9 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
if (edit_branch_description(branch_name))
return 1;
} else if (rename) {
- if (argc == 1)
+ if (!argc)
+ die(_("branch name required"));
+ else if (argc == 1)
rename_branch(head, argv[0], rename > 1);
else if (argc == 2)
rename_branch(argv[0], argv[1], rename > 1);
View
2  t/t3200-branch.sh
@@ -75,7 +75,7 @@ test_expect_success 'git branch l should work after branch l/m has been deleted'
test_expect_success 'git branch -m dumps usage' '
test_expect_code 128 git branch -m 2>err &&
- test_i18ngrep "too many branches for a rename operation" err
+ test_i18ngrep "branch name required" err
'
test_expect_success 'git branch -m m m/m should work' '
Please sign in to comment.
Something went wrong with that request. Please try again.