mirror of
https://github.com/git/git.git
synced 2026-04-09 16:30:38 +02:00
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.
This commit is contained in:
58
t/t3201-branch-contains.sh
Executable file
58
t/t3201-branch-contains.sh
Executable file
@@ -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
|
||||
Reference in New Issue
Block a user