From: Junio C Hamano Date: Wed, 5 Oct 2011 19:36:23 +0000 (-0700) Subject: Merge branch 'mg/branch-list' X-Git-Tag: v1.7.8-rc0~129 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1077bf1ff676cd172a09b88204422228f21d7cbf;p=git.git Merge branch 'mg/branch-list' * mg/branch-list: t3200: clean up checks for file existence branch: -v does not automatically imply --list branch: allow pattern arguments branch: introduce --list option git-branch: introduce missing long forms for the options git-tag: introduce long forms for the options t6040: test branch -vv Conflicts: Documentation/git-tag.txt t/t3200-branch.sh --- 1077bf1ff676cd172a09b88204422228f21d7cbf diff --cc t/t3200-branch.sh index 7633930bb,d53010387..2f5eada0d --- a/t/t3200-branch.sh +++ b/t/t3200-branch.sh @@@ -98,18 -98,38 +98,50 @@@ test_expect_success 'git branch -m q r/ test_must_fail git branch -m q r/q ' +test_expect_success 'git branch -M foo bar should fail when bar is checked out' ' + git branch bar && + git checkout -b foo && + test_must_fail git branch -M bar foo +' + +test_expect_success 'git branch -M baz bam should succeed when baz is checked out' ' + git checkout -b baz && + git branch bam && + git branch -M baz bam +' + + test_expect_success 'git branch -v -d t should work' ' + git branch t && + test_path_is_file .git/refs/heads/t && + git branch -v -d t && + test_path_is_missing .git/refs/heads/t + ' + + test_expect_success 'git branch -v -m t s should work' ' + git branch t && + test_path_is_file .git/refs/heads/t && + git branch -v -m t s && + test_path_is_missing .git/refs/heads/t && + test_path_is_file .git/refs/heads/s && + git branch -d s + ' + + test_expect_success 'git branch -m -d t s should fail' ' + git branch t && + test_path_is_file .git/refs/heads/t && + test_must_fail git branch -m -d t s && + git branch -d t && + test_path_is_missing .git/refs/heads/t + ' + + test_expect_success 'git branch --list -d t should fail' ' + git branch t && + test_path_is_file .git/refs/heads/t && + test_must_fail git branch --list -d t && + git branch -d t && + test_path_is_missing .git/refs/heads/t + ' + mv .git/config .git/config-saved test_expect_success 'git branch -m q q2 without config should succeed' '