diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-03-08 00:36:01 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-03-08 00:36:01 -0800 |
commit | 030bc0aa8b012170b69f40f95b152a1080447301 (patch) | |
tree | 0f77de6b03c86309a6157fc778fcc783910e1423 /t | |
parent | Merge branch 'ml/maint-grep-doc' into maint (diff) | |
parent | reflog: honor gc.reflogexpire=never (diff) | |
download | tgif-030bc0aa8b012170b69f40f95b152a1080447301.tar.xz |
Merge branch 'as/maint-expire' into maint
* as/maint-expire:
reflog: honor gc.reflogexpire=never
prune: honor --expire=never
Diffstat (limited to 't')
-rwxr-xr-x | t/t1410-reflog.sh | 41 | ||||
-rwxr-xr-x | t/t5304-prune.sh | 32 |
2 files changed, 73 insertions, 0 deletions
diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh index 80af6b9b7e..25046c4208 100755 --- a/t/t1410-reflog.sh +++ b/t/t1410-reflog.sh @@ -214,4 +214,45 @@ test_expect_success 'delete' ' ' +test_expect_success 'rewind2' ' + + test_tick && git reset --hard HEAD~2 && + loglen=$(wc -l <.git/logs/refs/heads/master) && + test $loglen = 4 + +' + +test_expect_success '--expire=never' ' + + git reflog expire --verbose \ + --expire=never \ + --expire-unreachable=never \ + --all && + loglen=$(wc -l <.git/logs/refs/heads/master) && + test $loglen = 4 + +' + +test_expect_success 'gc.reflogexpire=never' ' + + git config gc.reflogexpire never && + git config gc.reflogexpireunreachable never && + git reflog expire --verbose --all && + loglen=$(wc -l <.git/logs/refs/heads/master) && + test $loglen = 4 +' + +test_expect_success 'gc.reflogexpire=false' ' + + git config gc.reflogexpire false && + git config gc.reflogexpireunreachable false && + git reflog expire --verbose --all && + loglen=$(wc -l <.git/logs/refs/heads/master) && + test $loglen = 4 && + + git config --unset gc.reflogexpire && + git config --unset gc.reflogexpireunreachable + +' + test_done 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 && |