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
20 cmd git checkout guilt
/master
22 cmd git checkout master
26 cmd
rm -r .git
/patches
/$1
31 function fixup_time_info
33 touch -a -m -t "$TOUCH_DATE" ".git/patches/master/$1"
42 # Pop and push patches. Check that the repo is converted to new-style
43 # refs when no patches are applied and a patch is pushed.
44 old_style_branch master
59 # Check that "pop -a" does the right thing.
62 old_style_branch master
70 # Check that pushing two patches converts the repo to now-style (since
71 # it currently has no patches applied).
75 # Check guilt branch with a few patches applied.
76 old_style_branch master
77 cmd guilt branch topic
80 # Check that the topic branch is converted to new-style.
87 # Check guilt branch with the full patch series applied.
89 old_style_branch master
90 cmd guilt branch topic
95 # Check guilt branch with no patches applied.
96 # This gives us a new-style checkout.
97 cmd guilt branch topic
103 # Check guilt branch in a new-style directory with all patches
104 # applied. (Strictly speaking, this test should probably move to a
105 # file devoted to testing "guilt branch".)
107 cmd guilt branch topic
115 # Check that "guilt new" does the right thing when no patches are
116 # applied. (Strictly speaking, this test should maybe move to
119 cmd guilt new newpatch
120 cmd git for-each-ref
'--format=%(refname)'
122 fixup_time_info newpatch
126 # Check that "guilt commit" does the right thing when committing all
127 # applied patches. (Strictly speaking, this test should maybe move to
135 # Check that "guilt commit" does the right thing when committing only
136 # a few of the applied patches. (Strictly speaking, this test should
137 # maybe move to t-030.sh).
142 cmd guilt commit
-n 2
145 cmd guilt commit
-n 2