Re: [PATCH] Add "--expire <time>" option to 'git prune'
Johannes Schindelin schrieb:
Show 7 quoted lines
> +test_expect_success 'prune --expire' '
> +
> + BLOB=$(echo aleph | git hash-object -w --stdin) &&
> + BLOB_FILE=.git/objects/$(echo $BLOB | sed "s/^../&\//") &&
> + test 20 = $(git count-objects | sed "s/ .*//") &&
> + test -f $BLOB_FILE &&
> + git reset --hard &&
Here you could throw in:
git prune --expire=1.hour.ago &&
test 20 = $(git count-objects | sed "s/ .*//") &&
test -f $BLOB_FILE &&
to test that the object is not pruned (and the alternate --expire syntax).
Show 8 quoted lines
> + if touch -d "Jan 1 1970" $BLOB_FILE
> + then
> + git prune --expire 1.day &&
> + test 19 = $(git count-objects | sed "s/ .*//") &&
> + ! test -f $BLOB_FILE
> + else
> + say "Skipping test due to non-working touch -d"
> + fi