aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-12-01 13:58:54 -0800
committerJunio C Hamano <gitster@pobox.com>2007-12-01 13:58:54 -0800
commit5fa00a4dcf5d283c0af50b246b60977c66193c63 (patch)
tree366a867165f16aec0c35c4c61ffaa775f5be2f79 /t
parentc4d48ab5afc34b59582593622ef04da2543573d4 (diff)
parent3f7dfe77b71ff0ae78923518ab5ca28b0cf4d786 (diff)
downloadgit-5fa00a4dcf5d283c0af50b246b60977c66193c63.tar.gz
git-5fa00a4dcf5d283c0af50b246b60977c66193c63.tar.xz
Merge branch 'jc/branch-contains'
* jc/branch-contains: git-branch --contains: doc and test git-branch --contains=commit parse-options: Allow to hide options from the default usage.
Diffstat (limited to 't')
-rwxr-xr-xt/t3201-branch-contains.sh58
1 files changed, 58 insertions, 0 deletions
diff --git a/t/t3201-branch-contains.sh b/t/t3201-branch-contains.sh
new file mode 100755
index 000000000..9ef593f0e
--- /dev/null
+++ b/t/t3201-branch-contains.sh
@@ -0,0 +1,58 @@
+#!/bin/sh
+
+test_description='branch --contains <commit>'
+
+. ./test-lib.sh
+
+test_expect_success setup '
+
+ >file &&
+ git add file &&
+ test_tick &&
+ git commit -m initial &&
+ git branch side &&
+
+ echo 1 >file &&
+ test_tick &&
+ git commit -a -m "second on master" &&
+
+ git checkout side &&
+ echo 1 >file &&
+ test_tick &&
+ git commit -a -m "second on side" &&
+
+ git merge master
+
+'
+
+test_expect_success 'branch --contains=master' '
+
+ git branch --contains=master >actual &&
+ {
+ echo " master" && echo "* side"
+ } >expect &&
+ diff -u expect actual
+
+'
+
+test_expect_success 'branch --contains master' '
+
+ git branch --contains master >actual &&
+ {
+ echo " master" && echo "* side"
+ } >expect &&
+ diff -u expect actual
+
+'
+
+test_expect_success 'branch --contains=side' '
+
+ git branch --contains=side >actual &&
+ {
+ echo "* side"
+ } >expect &&
+ diff -u expect actual
+
+'
+
+test_done