X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=t%2Ft4200-rerere.sh;fp=t%2Ft4200-rerere.sh;h=36255d608a7af7d85f479986e302138401f25a8d;hb=8aed4a5e38a2a4f31567e01ab2a73341e972c08a;hp=876f09a6fef39fa2f7ef1ba8bd4898225bd5125a;hpb=7610fa57e63b0acc0a66717fc2d85755634db591;p=thirdparty%2Fgit.git diff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh index 876f09a6fe..36255d608a 100755 --- a/t/t4200-rerere.sh +++ b/t/t4200-rerere.sh @@ -166,6 +166,8 @@ test_expect_success 'first postimage wins' ' git commit -q -a -m "prefer first over second" && test -f $rr/postimage && + oldmtimepost=$(test-chmtime -v -60 $rr/postimage | cut -f 1) && + git checkout -b third master && git show second^:a1 | sed "s/To die: t/To die! T/" >a1 && git commit -q -a -m third && @@ -176,6 +178,11 @@ test_expect_success 'first postimage wins' ' test_cmp expect a1 ' +test_expect_success 'rerere updates postimage timestamp' ' + newmtimepost=$(test-chmtime -v +0 $rr/postimage | cut -f 1) && + test $oldmtimepost -lt $newmtimepost +' + test_expect_success 'rerere clear' ' rm $rr/postimage && echo "$sha1 a1" | perl -pe "y/\012/\000/" >.git/MERGE_RR && @@ -198,18 +205,19 @@ test_expect_success 'set up for garbage collection tests' ' almost_60_days_ago=$((60-60*86400)) && just_over_60_days_ago=$((-1-60*86400)) && - test-chmtime =$almost_60_days_ago $rr/preimage && + test-chmtime =$just_over_60_days_ago $rr/preimage && + test-chmtime =$almost_60_days_ago $rr/postimage && test-chmtime =$almost_15_days_ago $rr2/preimage ' -test_expect_success 'garbage collection preserves young records' ' +test_expect_success 'gc preserves young or recently used records' ' git rerere gc && test -f $rr/preimage && test -f $rr2/preimage ' test_expect_success 'old records rest in peace' ' - test-chmtime =$just_over_60_days_ago $rr/preimage && + test-chmtime =$just_over_60_days_ago $rr/postimage && test-chmtime =$just_over_15_days_ago $rr2/preimage && git rerere gc && ! test -f $rr/preimage &&