3 test_description='script tattoo'
7 export PATH=$PATH:../../scripts
9 test_expect_success 'setup' '
12 git commit -m "setup" &&
13 git clone ./. server &&
14 rm -fr server/.git/hooks &&
15 git remote add origin ./server &&
16 git checkout -b stable &&
17 git push origin stable
20 test_expect_success 'tattoo 0' '
21 git checkout -b topic1 &&
22 git push origin topic1 &&
23 gc-tattoo | grep topic1-0
26 test_expect_success 'tattoo 1' '
27 echo "$test_name" >a &&
28 git commit -a -m "make topic1-1" &&
29 git push origin topic1 &&
30 gc-tattoo | grep topic1-1
33 test_expect_success 'merge topic2 topic1 as tattoo 2' '
34 git checkout -b topic2 stable &&
35 echo "$test_name" >a.topic2 &&
37 git commit -m "make topic2" &&
38 git push origin topic2 &&
39 gc-tattoo | grep topic2-1
41 git checkout topic1 &&
43 git push origin topic1 &&
44 gc-tattoo | grep topic1-2
47 test_expect_success 'stable without a tag' '
48 git checkout stable &&
49 head=$(git rev-parse HEAD) &&
50 gc-tattoo | grep "stable-$head"
53 test_expect_success 'stable with a tag' '
54 git tag -m "1.0" 1.0 &&
55 gc-tattoo | grep "1.0"
58 test_expect_success 'fails if not pushed' '
59 git checkout topic1 &&
60 echo "$test_name" >a &&
61 git commit -a -m "make topic1-3" &&
62 gc-tattoo | grep "topic1 has not been pushed"
65 test_expect_success 'stable fails if not pushed' '
66 git checkout stable &&
67 git merge --no-ff topic1 &&
68 gc-tattoo | grep "stable has not been pushed"
71 test_expect_success 'use origin stable not local' '
72 git checkout topic1 &&
73 git push origin topic1 &&
74 gc-tattoo | grep "topic1-3"