test-lib*.sh: set GIT_CEILING_DIRECTORIES
[topgit/pro.git] / t / t1050-status.sh
blob222638d544b238f893a6dbdb750d1ac2b4d03e1f
1 #!/bin/sh
3 test_description='tg status
5 Make sure tg status detects everything it should.
8 . ./test-lib.sh
10 test_plan 15
12 unborn='HEAD -> refs/heads/master (unborn)
13 working directory is clean'
15 born='HEAD -> refs/heads/master (7cfc564)
16 working directory is clean'
18 headborn='HEAD -> refs/heads/master (7cfc564)
20 allfixed='
21 all conflicts fixed; run "git commit" to record result'
23 unignored="; non-ignored, untracked files present"
25 moof="; currently updating branch 'moof'"
27 resultof='
28 You are currently updating as a result of:
31 lf='
34 updatecmds='
35 (use "tg update --continue" to continue)
36 (use "tg update --skip" to skip this branch and continue)
37 (use "tg update --stop" to stop and retain updates so far)
38 (use "tg update --abort" to restore pre-update state)'
40 workclean='
41 working directory is clean'
44 test_expect_success 'tg status unborn' '
45 test "$unborn" = "$(tg status)"
48 test_expect_success 'tg status unborn untracked' '
49 >not-ignored &&
50 test "$unborn$unignored" = "$(tg status)" &&
51 rm not-ignored
54 test_tick || die
56 test_expect_success LASTOK 'tg status born' '
57 test_commit --notick initial &&
58 test "$born" = "$(tg status)"
61 test_expect_success 'tg status born untracked' '
62 >not-ignored &&
63 test "$born$unignored" = "$(tg status)" &&
64 rm not-ignored
67 test_expect_success LASTOK 'tg status merge' '
68 >.git/MERGE_HEAD &&
69 test "${headborn}git merge in progress$allfixed" = "$(tg status)" &&
70 rm -f .git/MERGE_HEAD
73 test_expect_success LASTOK 'tg status am' '
74 mkdir .git/rebase-apply &&
75 >.git/rebase-apply/applying &&
76 test "${headborn}git am in progress" = "$(tg status)" &&
77 rm -rf .git/rebase-apply
80 test_expect_success LASTOK 'tg status rebase apply' '
81 mkdir .git/rebase-apply &&
82 test "${headborn}git rebase in progress" = "$(tg status)" &&
83 rm -rf .git/rebase-apply
86 test_expect_success LASTOK 'tg status rebase merge' '
87 mkdir .git/rebase-merge &&
88 test "${headborn}git rebase in progress" = "$(tg status)" &&
89 rm -rf .git/rebase-merge
92 test_expect_success LASTOK 'tg status cherry-pick' '
93 >.git/CHERRY_PICK_HEAD &&
94 test "${headborn}git cherry-pick in progress" = "$(tg status)" &&
95 rm -f .git/CHERRY_PICK_HEAD
98 test_expect_success LASTOK 'tg status bisect' '
99 >.git/BISECT_LOG &&
100 test "${headborn}git bisect in progress" = "$(tg status)" &&
101 rm -f .git/BISECT_LOG
104 test_expect_success LASTOK 'tg status revert' '
105 >.git/REVERT_HEAD &&
106 test "${headborn}git revert in progress" = "$(tg status)" &&
107 rm -f .git/REVERT_HEAD
110 test_expect_success LASTOK 'tg status update' '
111 mkdir .git/tg-update &&
112 >.git/tg-update/name &&
113 test "${headborn}tg update in progress$updatecmds$workclean" = "$(tg status)" &&
114 rm -rf .git/tg-update
117 test_expect_success LASTOK 'tg status update moof' '
118 mkdir .git/tg-update &&
119 echo moof >.git/tg-update/name &&
120 test "${headborn}tg update in progress$moof$updatecmds$workclean" = "$(tg status)" &&
121 rm -rf .git/tg-update
124 test_expect_success LASTOK 'tg status update moofing moof' '
125 mkdir .git/tg-update &&
126 echo moof >.git/tg-update/name &&
127 echo moof >.git/tg-update/names &&
128 echo "moofing moof" > .git/tg-update/fullcmd &&
129 test "${headborn}tg update in progress$moof${resultof}moofing moof$updatecmds$workclean" = "$(tg status)" &&
130 rm -rf .git/tg-update
133 test_expect_success LASTOK 'tg status update moofing moof woof' '
134 mkdir .git/tg-update &&
135 echo moof >.git/tg-update/name &&
136 echo moof woof >.git/tg-update/names &&
137 echo moof >.git/tg-update/processed &&
138 echo "moofing moof" > .git/tg-update/fullcmd &&
139 test "${headborn}tg update in progress$moof${resultof}moofing moof${lf}1 of 2 branches updated so far$updatecmds$workclean" = "$(tg status)" &&
140 rm -rf .git/tg-update
143 test_done