1 #!/bin/sh
2 #
3 # Copyright (c) 2008 Johannes E. Schindelin
4 #
6 test_description='prune'
7 . ./test-lib.sh
9 test_expect_success setup '
11 : > file &&
12 git add file &&
13 test_tick &&
14 git commit -m initial &&
15 git gc
17 '
19 test_expect_success 'prune stale packs' '
21 orig_pack=$(echo .git/objects/pack/*.pack) &&
22 : > .git/objects/tmp_1.pack &&
23 : > .git/objects/tmp_2.pack &&
24 test-chmtime -86501 .git/objects/tmp_1.pack &&
25 git prune --expire 1.day &&
26 test -f $orig_pack &&
27 test -f .git/objects/tmp_2.pack &&
28 ! test -f .git/objects/tmp_1.pack
30 '
32 test_done