3 # Test the branch-switching upgrade code
6 source $REG_DIR/scaffold
9 # Modify the refs so that it looks as if the patch series was applied
10 # by an old version of guilt.
11 cmd git update-ref refs
/heads
/$1 refs
/heads
/guilt
/$1
12 cmd git symbolic-ref HEAD refs
/heads
/$1
13 cmd git update-ref
-d refs
/heads
/guilt
/$1
18 if git rev-parse
--verify --quiet guilt
/master
>/dev
/null
; then
19 cmd git checkout guilt
/master
21 cmd git checkout master
25 cmd
rm -r .git
/patches
/$1
30 function fixup_time_info
32 touch -a -m -t "$TOUCH_DATE" ".git/patches/master/$1"
41 # Pop and push patches. Check that the repo is converted to new-style
42 # refs when no patches are applied and a patch is pushed.
43 old_style_branch master
61 # Check that "pop -a" does the right thing.
64 old_style_branch master
72 # Check that pushing two patches converts the repo to now-style (since
73 # it currently has no patches applied).
77 # Check guilt branch with a few patches applied.
78 old_style_branch master
79 cmd guilt branch topic
82 # Check that the topic branch is converted to new-style.
89 # Check guilt branch with the full patch series applied.
91 old_style_branch master
92 cmd guilt branch topic
97 # Check guilt branch with no patches applied.
98 # This gives us a new-style checkout.
99 cmd guilt branch topic
105 # Check guilt branch in a new-style directory with all patches
106 # applied. (Strictly speaking, this test should probably move to a
107 # file devoted to testing "guilt branch".)
109 cmd guilt branch topic
117 # Check that "guilt new" does the right thing when no patches are
118 # applied. (Strictly speaking, this test should maybe move to
121 cmd guilt new newpatch
122 cmd git for-each-ref
'--format=%(refname)'
124 fixup_time_info newpatch
128 # Check that "guilt commit" does the right thing when committing all
129 # applied patches. (Strictly speaking, this test should maybe move to
137 # Check that "guilt commit" does the right thing when committing only
138 # a few of the applied patches. (Strictly speaking, this test should
139 # maybe move to t-030.sh).
144 cmd guilt commit
-n 2
147 cmd guilt commit
-n 2