diff options
Diffstat (limited to 't')
-rwxr-xr-x | t/t4200-rerere.sh | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh index 8f5f268baf..1e23031cdb 100755 --- a/t/t4200-rerere.sh +++ b/t/t4200-rerere.sh @@ -420,19 +420,28 @@ count_pre_post () { } test_expect_success 'rerere gc' ' - find .git/rr-cache -type f >original && - xargs test-chmtime -172800 <original && + rm -fr .git/rr-cache && + rr=.git/rr-cache/$_z40 && + mkdir -p "$rr" && + >"$rr/preimage" && + >"$rr/postimage" && + + two_days_ago=$((-2*86400)) && + test-chmtime =$two_days_ago "$rr/preimage" && + test-chmtime =$two_days_ago "$rr/postimage" && + + find .git/rr-cache -type f | sort >original && git -c gc.rerereresolved=5 -c gc.rerereunresolved=5 rerere gc && - find .git/rr-cache -type f >actual && + find .git/rr-cache -type f | sort >actual && test_cmp original actual && git -c gc.rerereresolved=5 -c gc.rerereunresolved=0 rerere gc && - find .git/rr-cache -type f >actual && + find .git/rr-cache -type f | sort >actual && test_cmp original actual && git -c gc.rerereresolved=0 -c gc.rerereunresolved=0 rerere gc && - find .git/rr-cache -type f >actual && + find .git/rr-cache -type f | sort >actual && >expect && test_cmp expect actual ' |