Subject: Re: tests for pre-auto-gc hook

From: Johannes Sixt <[email-masked]>
Date: Fri, 04 Apr 2008 08:34:39 +0200

Miklos Vajna schrieb:
> I wanted to create a test like t7503-pre-commit-hook.sh for pre-auto-gc
> but actually I'm not sure how to trigger git gc --auto to do something.
> 
> Here is what I managed to do so far:
> 
> ----
> git init
> git config gc.auto 1
> for i in `seq 1 500`; do echo $i >file; git add file; done
> git commit -m init
> ----

Avoid 'seq'; it is not available everywhere. To avoid spawning 500
processes, you could create a pack file from the files using fastimport,
then unpack that for each test case. But you must move the pack out of
.git/objects/pack before unpacking, otherwise it won't unpack anything.

-- Hannes