t4200: gather "rerere gc" together

Move the "rerere gc with custom expiry" test up, so that it is close to the existing basic "rerere gc" tests. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Aug 22, 2017 at 14:20 UTC 1ad8b47354979515cfd1a50035208b1185f99f9c
1 file changed +27 -27
t/t4200-rerere.sh
+27 -27
@@ -239,6 +239,33 @@ test_expect_success 'old records rest in peace' '
239 ! test -f $rr2/preimage
240 '
241
242 +test_expect_success 'rerere gc with custom expiry' '
243 + rm -fr .git/rr-cache &&
244 + rr=.git/rr-cache/$_z40 &&
245 + mkdir -p "$rr" &&
246 + >"$rr/preimage" &&
247 + >"$rr/postimage" &&
248 +
249 + two_days_ago=$((-2*86400)) &&
250 + test-chmtime =$two_days_ago "$rr/preimage" &&
251 + test-chmtime =$two_days_ago "$rr/postimage" &&
252 +
253 + find .git/rr-cache -type f | sort >original &&
254 +
255 + git -c gc.rerereresolved=5 -c gc.rerereunresolved=5 rerere gc &&
256 + find .git/rr-cache -type f | sort >actual &&
257 + test_cmp original actual &&
258 +
259 + git -c gc.rerereresolved=5 -c gc.rerereunresolved=0 rerere gc &&
260 + find .git/rr-cache -type f | sort >actual &&
261 + test_cmp original actual &&
262 +
263 + git -c gc.rerereresolved=0 -c gc.rerereunresolved=0 rerere gc &&
264 + find .git/rr-cache -type f | sort >actual &&
265 + >expect &&
266 + test_cmp expect actual
267 +'
268 +
269 test_expect_success 'setup: file2 added differently in two branches' '
270 git reset --hard &&
271
@@ -419,33 +446,6 @@ count_pre_post () {
446 test_line_count = "$2" actual
447 }
448
422 -test_expect_success 'rerere gc' '
423 - rm -fr .git/rr-cache &&
424 - rr=.git/rr-cache/$_z40 &&
425 - mkdir -p "$rr" &&
426 - >"$rr/preimage" &&
427 - >"$rr/postimage" &&
428 -
429 - two_days_ago=$((-2*86400)) &&
430 - test-chmtime =$two_days_ago "$rr/preimage" &&
431 - test-chmtime =$two_days_ago "$rr/postimage" &&
432 -
433 - find .git/rr-cache -type f | sort >original &&
434 -
435 - git -c gc.rerereresolved=5 -c gc.rerereunresolved=5 rerere gc &&
436 - find .git/rr-cache -type f | sort >actual &&
437 - test_cmp original actual &&
438 -
439 - git -c gc.rerereresolved=5 -c gc.rerereunresolved=0 rerere gc &&
440 - find .git/rr-cache -type f | sort >actual &&
441 - test_cmp original actual &&
442 -
443 - git -c gc.rerereresolved=0 -c gc.rerereunresolved=0 rerere gc &&
444 - find .git/rr-cache -type f | sort >actual &&
445 - >expect &&
446 - test_cmp expect actual
447 -'
448 -
449 merge_conflict_resolve () {
450 git reset --hard &&
451 test_must_fail git merge six.1 &&