t6007: test rev-list --cherry
[git/dscho.git] / t / t6017-rev-list-stdin.sh
blobf1c32dba423316641197dbfe19b2b95581acebad
1 #!/bin/sh
3 # Copyright (c) 2009, Junio C Hamano
6 test_description='log family learns --stdin'
8 . ./test-lib.sh
10 check () {
11 for cmd in rev-list "log --stat"
13 for i in "$@"
15 printf "%s\n" $i
16 done >input &&
17 test_expect_success "check $cmd $*" '
18 git $cmd $(cat input) >expect &&
19 git $cmd --stdin <input >actual &&
20 sed -e "s/^/input /" input &&
21 sed -e "s/^/output /" expect &&
22 test_cmp expect actual
24 done
27 them='1 2 3 4 5 6 7'
29 test_expect_success setup '
31 for i in 0 $them
33 for j in $them
35 echo $i.$j >file-$j &&
36 git add file-$j || exit
37 done &&
38 test_tick &&
39 git commit -m $i || exit
40 done &&
41 for i in $them
43 git checkout -b side-$i master~$i &&
44 echo updated $i >file-$i &&
45 git add file-$i &&
46 test_tick &&
47 git commit -m side-$i || exit
48 done
52 check master
53 check side-1 ^side-4
54 check side-1 ^side-7 --
55 check side-1 ^side-7 -- file-1
56 check side-1 ^side-7 -- file-2
57 check side-3 ^side-4 -- file-3
58 check side-3 ^side-2
59 check side-3 ^side-2 -- file-1
61 test_done