t7600 (merge): test merge from branch yet to be born
Some people like to "git fetch origin && merge origin/master" from the unborn branch provided when first initializing a repository. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jonathan Nieder committed
Aug 17, 2010 at 01:56 UTC
94d63ce2abfd8de9dc3c928383270ec6ca3605bb
1 file changed
+21
t/t7600-merge.sh
+21
@@ -173,6 +173,27 @@ test_expect_success 'merge c0 with c1 with --ff-only' '
173
174
test_debug 'git log --graph --decorate --oneline --all'
175
176
+test_expect_success 'merge from unborn branch' '
177
+ git checkout -f master &&
178
+ test_might_fail git branch -D kid &&
179
+
180
+ echo "OBJID HEAD@{0}: initial pull" >reflog.expected &&
181
+
182
+ git checkout --orphan kid &&
183
+ test_when_finished "git checkout -f master" &&
184
+ git rm -fr . &&
185
+ test_tick &&
186
+ git merge --ff-only c1 &&
187
+ verify_merge file result.1 &&
188
+ verify_head "$c1" &&
189
+
190
+ git reflog -1 >reflog.actual &&
191
+ sed "s/$_x05[0-9a-f][0-9a-f]/OBJID/g" reflog.actual >reflog.fuzzy &&
192
+ test_cmp reflog.expected reflog.fuzzy
193
+'
194
+
195
+test_debug 'git log --graph --decorate --oneline --all'
196
+
197
test_expect_success 'merge c1 with c2' '
198
git reset --hard c1 &&
199
test_tick &&