diff options
author | Adam Simpkins <simpkins@facebook.com> | 2010-02-26 19:50:02 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-02-28 10:28:05 -0800 |
commit | cbf731ed4ec511f2c32598e03d7865f35881fea2 (patch) | |
tree | dc54c7b061bdb678c045a74d40255417bdfa7393 /t/t5304-prune.sh | |
parent | 64da6e20de1f2246e2d8d9d85e53ca3cbf393212 (diff) | |
download | git-cbf731ed4ec511f2c32598e03d7865f35881fea2.tar.gz |
prune: honor --expire=never
Previously, prune treated an expiration time of 0 to mean that no
expire argument was supplied, and everything should be pruned. As a
result, "prune --expire=never" would prune all unreachable objects,
regardless of their timestamp.
prune can be called with --expire=never automatically by gc, when the
gc.pruneExpire configuration is set to "never".
Signed-off-by: Adam Simpkins <simpkins@facebook.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5304-prune.sh')
-rwxr-xr-x | t/t5304-prune.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/t/t5304-prune.sh b/t/t5304-prune.sh index 3c6687abec..e2ed13dba2 100755 --- a/t/t5304-prune.sh +++ b/t/t5304-prune.sh @@ -148,6 +148,38 @@ test_expect_success 'gc --prune=<date>' ' ' +test_expect_success 'gc --prune=never' ' + + add_blob && + git gc --prune=never && + test -f $BLOB_FILE && + git gc --prune=now && + test ! -f $BLOB_FILE + +' + +test_expect_success 'gc respects gc.pruneExpire=never' ' + + git config gc.pruneExpire never && + add_blob && + git gc && + test -f $BLOB_FILE && + git config gc.pruneExpire now && + git gc && + test ! -f $BLOB_FILE + +' + +test_expect_success 'prune --expire=never' ' + + add_blob && + git prune --expire=never && + test -f $BLOB_FILE && + git prune && + test ! -f $BLOB_FILE + +' + test_expect_success 'gc: prune old objects after local clone' ' add_blob && test-chmtime =-$((2*$week+1)) $BLOB_FILE && |