You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
551 B
33 lines
551 B
17 years ago
|
#!/bin/sh
|
||
|
#
|
||
|
# Copyright (c) 2008 Johannes E. Schindelin
|
||
|
#
|
||
|
|
||
|
test_description='prune'
|
||
|
. ./test-lib.sh
|
||
|
|
||
|
test_expect_success setup '
|
||
|
|
||
|
: > file &&
|
||
|
git add file &&
|
||
|
test_tick &&
|
||
|
git commit -m initial &&
|
||
|
git gc
|
||
|
|
||
|
'
|
||
|
|
||
|
test_expect_success 'prune stale packs' '
|
||
|
|
||
|
orig_pack=$(echo .git/objects/pack/*.pack) &&
|
||
|
: > .git/objects/tmp_1.pack &&
|
||
|
: > .git/objects/tmp_2.pack &&
|
||
|
test-chmtime -86501 .git/objects/tmp_1.pack &&
|
||
|
git prune --expire 1.day &&
|
||
|
test -f $orig_pack &&
|
||
|
test -f .git/objects/tmp_2.pack &&
|
||
|
! test -f .git/objects/tmp_1.pack
|
||
|
|
||
|
'
|
||
|
|
||
|
test_done
|