Junio C Hamano | 3f7dfe7 | 2007-11-18 22:22:00 -0800 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | test_description='branch --contains <commit>' |
| 4 | |
| 5 | . ./test-lib.sh |
| 6 | |
| 7 | test_expect_success setup ' |
| 8 | |
| 9 | >file && |
| 10 | git add file && |
| 11 | test_tick && |
| 12 | git commit -m initial && |
| 13 | git branch side && |
| 14 | |
| 15 | echo 1 >file && |
| 16 | test_tick && |
| 17 | git commit -a -m "second on master" && |
| 18 | |
| 19 | git checkout side && |
| 20 | echo 1 >file && |
| 21 | test_tick && |
| 22 | git commit -a -m "second on side" && |
| 23 | |
| 24 | git merge master |
| 25 | |
| 26 | ' |
| 27 | |
| 28 | test_expect_success 'branch --contains=master' ' |
| 29 | |
| 30 | git branch --contains=master >actual && |
| 31 | { |
| 32 | echo " master" && echo "* side" |
| 33 | } >expect && |
| 34 | diff -u expect actual |
| 35 | |
| 36 | ' |
| 37 | |
| 38 | test_expect_success 'branch --contains master' ' |
| 39 | |
| 40 | git branch --contains master >actual && |
| 41 | { |
| 42 | echo " master" && echo "* side" |
| 43 | } >expect && |
| 44 | diff -u expect actual |
| 45 | |
| 46 | ' |
| 47 | |
| 48 | test_expect_success 'branch --contains=side' ' |
| 49 | |
| 50 | git branch --contains=side >actual && |
| 51 | { |
| 52 | echo "* side" |
| 53 | } >expect && |
| 54 | diff -u expect actual |
| 55 | |
| 56 | ' |
| 57 | |
| 58 | test_done |