]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jm/branch-rename-nothing-error'
authorJunio C Hamano <gitster@pobox.com>
Wed, 3 Apr 2013 16:34:40 +0000 (09:34 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 3 Apr 2013 16:34:40 +0000 (09:34 -0700)
"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

1  2 
builtin/branch.c
t/t3200-branch.sh

Simple merge
index b08c9f22951bf447cc769c043a165d087fa5e38d,a64c9d2dd3732170918e7891854c0400d7f88b9e..8311c7da440a5932107cd8e4787f236c29518861
@@@ -47,48 -49,48 +47,48 @@@ test_expect_success 'git branch HEAD sh
  cat >expect <<EOF
  $_z40 $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000       branch: Created from master
  EOF
 -test_expect_success \
 -    'git branch -l d/e/f should create a branch and a log' \
 -      'GIT_COMMITTER_DATE="2005-05-26 23:30" \
 -     git branch -l d/e/f &&
 -       test_path_is_file .git/refs/heads/d/e/f &&
 -       test_path_is_file .git/logs/refs/heads/d/e/f &&
 -       test_cmp expect .git/logs/refs/heads/d/e/f'
 -
 -test_expect_success \
 -    'git branch -d d/e/f should delete a branch and a log' \
 -      'git branch -d d/e/f &&
 -       test_path_is_missing .git/refs/heads/d/e/f &&
 -       test_path_is_missing .git/logs/refs/heads/d/e/f'
 -
 -test_expect_success \
 -    'git branch j/k should work after branch j has been deleted' \
 -       'git branch j &&
 -        git branch -d j &&
 -        git branch j/k'
 -
 -test_expect_success \
 -    'git branch l should work after branch l/m has been deleted' \
 -       'git branch l/m &&
 -        git branch -d l/m &&
 -        git branch l'
 -
 -test_expect_success \
 -    'git branch -m dumps usage' \
 -       'test_expect_code 128 git branch -m 2>err &&
 -      test_i18ngrep "branch name required" err'
 -
 -test_expect_success \
 -    'git branch -m m m/m should work' \
 -       'git branch -l m &&
 -        git branch -m m m/m &&
 -      test_path_is_file .git/logs/refs/heads/m/m'
 -
 -test_expect_success \
 -    'git branch -m n/n n should work' \
 -       'git branch -l n/n &&
 +test_expect_success 'git branch -l d/e/f should create a branch and a log' '
 +      GIT_COMMITTER_DATE="2005-05-26 23:30" \
 +      git branch -l d/e/f &&
 +      test_path_is_file .git/refs/heads/d/e/f &&
 +      test_path_is_file .git/logs/refs/heads/d/e/f &&
 +      test_cmp expect .git/logs/refs/heads/d/e/f
 +'
 +
 +test_expect_success 'git branch -d d/e/f should delete a branch and a log' '
 +      git branch -d d/e/f &&
 +      test_path_is_missing .git/refs/heads/d/e/f &&
 +      test_path_is_missing .git/logs/refs/heads/d/e/f
 +'
 +
 +test_expect_success 'git branch j/k should work after branch j has been deleted' '
 +      git branch j &&
 +      git branch -d j &&
 +      git branch j/k
 +'
 +
 +test_expect_success 'git branch l should work after branch l/m has been deleted' '
 +      git branch l/m &&
 +      git branch -d l/m &&
 +      git branch l
 +'
 +
 +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' '
 +      git branch -l m &&
 +      git branch -m m m/m &&
 +      test_path_is_file .git/logs/refs/heads/m/m
 +'
 +
 +test_expect_success 'git branch -m n/n n should work' '
 +      git branch -l n/n &&
        git branch -m n/n n &&
 -      test_path_is_file .git/logs/refs/heads/n'
 +      test_path_is_file .git/logs/refs/heads/n
 +'
  
  test_expect_success 'git branch -m o/o o should fail when o/p exists' '
        git branch o/o &&