summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-05-05 19:16:06 -0700
committerJunio C Hamano <gitster@pobox.com>2008-05-05 19:16:06 -0700
commitb79c9859c8eb3bb4390f91320e126199ff884907 (patch)
treeecb36c8abbef20850f0c05e4ac003004d1b50b44 /t
parentdc484f2213a34ced5abe5eb968650035204b6035 (diff)
parentf9fd5210c825dfcd245a2cd38e7b12c03000c33f (diff)
downloadgit-b79c9859c8eb3bb4390f91320e126199ff884907.tar.gz
Merge branch 'lh/branch-merged'
* lh/branch-merged: Add tests for `branch --[no-]merged` git-branch.txt: compare --contains, --merged and --no-merged git-branch: add support for --merged and --no-merged
Diffstat (limited to 't')
-rwxr-xr-xt/t3201-branch-contains.sh42
1 files changed, 41 insertions, 1 deletions
diff --git a/t/t3201-branch-contains.sh b/t/t3201-branch-contains.sh
index b4cf628d22..f86f4bc5eb 100755
--- a/t/t3201-branch-contains.sh
+++ b/t/t3201-branch-contains.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-test_description='branch --contains <commit>'
+test_description='branch --contains <commit>, --merged, and --no-merged'
. ./test-lib.sh
@@ -55,4 +55,44 @@ test_expect_success 'branch --contains=side' '
'
+test_expect_success 'side: branch --merged' '
+
+ git branch --merged >actual &&
+ {
+ echo " master" &&
+ echo "* side"
+ } >expect &&
+ test_cmp expect actual
+
+'
+
+test_expect_success 'side: branch --no-merged' '
+
+ git branch --no-merged >actual &&
+ >expect &&
+ test_cmp expect actual
+
+'
+
+test_expect_success 'master: branch --merged' '
+
+ git checkout master &&
+ git branch --merged >actual &&
+ {
+ echo "* master"
+ } >expect &&
+ test_cmp expect actual
+
+'
+
+test_expect_success 'master: branch --no-merged' '
+
+ git branch --no-merged >actual &&
+ {
+ echo " side"
+ } >expect &&
+ test_cmp expect actual
+
+'
+
test_done