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 # tattoo makes assumptions based on the update stable hook sanity checks
21 install_update_hook 'update-stable'
23 test_expect_success 'tattoo of first commit' '
27 test_expect_success 'tattoo 1' '
28 git checkout -b topic1 &&
29 echo "$test_name" >a.topic1 &&
31 git commit -a -m "move topic1-1" &&
32 git push origin topic1 &&
33 gc-tattoo | grep topic1-1
36 test_expect_success 'tattoo 2' '
37 echo "$test_name" >a &&
38 git commit -a -m "make topic1-2" &&
39 git push origin topic1 &&
40 gc-tattoo | grep topic1-2
43 test_expect_success 'merge topic2 into topic1 as tattoo 3' '
44 git checkout -b topic2 stable &&
45 echo "$test_name" >a.topic2 &&
47 git commit -m "make topic2-1" &&
48 git push origin topic2 &&
49 gc-tattoo | grep topic2-1 &&
51 git checkout topic1 &&
53 git push origin topic1 &&
54 gc-tattoo | grep topic1-3 &&
56 git checkout topic2 &&
57 gc-tattoo | grep topic2-1
60 test_expect_success 'fails if not pushed' '
61 git checkout topic1 &&
62 echo "$test_name" >a &&
63 git commit -a -m "make topic1-4" &&
64 head=$(git rev-parse HEAD) &&
65 gc-tattoo | grep "$head has not been pushed" &&
66 git push origin topic1 &&
67 gc-tattoo | grep topic1-4
70 test_expect_success 'stable fails if not pushed' '
71 git checkout stable &&
72 git merge --no-ff topic1 &&
73 head=$(git rev-parse HEAD) &&
74 gc-tattoo | grep "$head has not been pushed" &&
76 gc-tattoo | grep "stable-$head"
79 test_expect_success 'stable without a tag' '
80 git checkout stable &&
81 head=$(git rev-parse HEAD) &&
82 gc-tattoo | grep "stable-$head"
85 test_expect_success 'stable with a tag' '
86 git tag -m "1.0" 1.0 &&
87 gc-tattoo | grep "1.0"
90 test_expect_success 'use origin stable not local' '
91 git checkout origin/stable &&
92 git branch -d stable &&
93 git checkout topic2 &&
94 gc-tattoo | grep "topic2-1"