diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-02-07 14:41:38 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-02-07 14:41:38 -0800 |
commit | f507784d2c956fc73f3791b04cc80e7e0dae0a4d (patch) | |
tree | 53e4add6b038d1a2d8a69b59a93315e71e5fca9a /t | |
parent | 9a1ab9e72fe8acd03b92bb481d7cd95207fda8f5 (diff) | |
parent | d040350813986e0f4bb3aeb977077975c1552606 (diff) | |
download | git-f507784d2c956fc73f3791b04cc80e7e0dae0a4d.tar.gz git-f507784d2c956fc73f3791b04cc80e7e0dae0a4d.tar.xz |
Merge branch 'nd/branch-error-cases'
Fix various error messages and conditions in "git branch", e.g. we
advertised "branch -d/-D" to remove one or more branches but actually
implemented removal of zero or more branches---request to remove no
branches was not rejected.
* nd/branch-error-cases:
branch: let branch filters imply --list
docs: clarify git-branch --list behavior
branch: mark more strings for translation
branch: give a more helpful message on redundant arguments
branch: reject -D/-d without branch name
Diffstat (limited to 't')
-rwxr-xr-x | t/t3200-branch.sh | 4 | ||||
-rwxr-xr-x | t/t3201-branch-contains.sh | 35 |
2 files changed, 37 insertions, 2 deletions
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh index 80e6be39d..f3e0e4a38 100755 --- a/t/t3200-branch.sh +++ b/t/t3200-branch.sh @@ -73,8 +73,8 @@ test_expect_success \ test_expect_success \ 'git branch -m dumps usage' \ - 'test_expect_code 129 git branch -m 2>err && - test_i18ngrep "[Uu]sage: git branch" err' + 'test_expect_code 128 git branch -m 2>err && + test_i18ngrep "too many branches for a rename operation" err' test_expect_success \ 'git branch -m m m/m should work' \ diff --git a/t/t3201-branch-contains.sh b/t/t3201-branch-contains.sh index f86f4bc5e..141b0611e 100755 --- a/t/t3201-branch-contains.sh +++ b/t/t3201-branch-contains.sh @@ -55,6 +55,16 @@ test_expect_success 'branch --contains=side' ' ' +test_expect_success 'branch --contains with pattern implies --list' ' + + git branch --contains=master master >actual && + { + echo " master" + } >expect && + test_cmp expect actual + +' + test_expect_success 'side: branch --merged' ' git branch --merged >actual && @@ -66,6 +76,16 @@ test_expect_success 'side: branch --merged' ' ' +test_expect_success 'branch --merged with pattern implies --list' ' + + git branch --merged=side master >actual && + { + echo " master" + } >expect && + test_cmp expect actual + +' + test_expect_success 'side: branch --no-merged' ' git branch --no-merged >actual && @@ -95,4 +115,19 @@ test_expect_success 'master: branch --no-merged' ' ' +test_expect_success 'branch --no-merged with pattern implies --list' ' + + git branch --no-merged=master master >actual && + >expect && + test_cmp expect actual + +' + +test_expect_success 'implicit --list conflicts with modification options' ' + + test_must_fail git branch --contains=master -d && + test_must_fail git branch --contains=master -m foo + +' + test_done |