aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLars Hjemli <hjemli@gmail.com>2008-04-18 18:30:15 +0200
committerJunio C Hamano <gitster@pobox.com>2008-04-20 18:16:46 -0700
commitf9fd5210c825dfcd245a2cd38e7b12c03000c33f (patch)
tree41dd675e648e80ae144ae5897cf23c1888e9a170 /t
parent9a7ea2b1f3484bb2a4bbd0b538e5a38df0356701 (diff)
downloadgit-f9fd5210c825dfcd245a2cd38e7b12c03000c33f.tar.gz
git-f9fd5210c825dfcd245a2cd38e7b12c03000c33f.tar.xz
Add tests for `branch --[no-]merged`
Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 b4cf628d2..f86f4bc5e 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