nix-prefetch-git: run single-threaded 'git repack'

Without this, the generated pack files are non-deterministic.

I didn't notice this issue in my earlier testing, because my test repo
had too few commits for the thread scheduling to take effect. (Test repo
had about 10 commits.)
This commit is contained in:
Bjørn Forsman 2014-11-03 22:51:56 +01:00
parent f891bc78d1
commit 96cacf01bf

View File

@ -226,9 +226,10 @@ make_deterministic_repo(){
fi
done
# Do a full repack, for determinism.
# Repack does not add unreferenced objects to a pack file.
# Do a full repack. Must run single-threaded, or else we loose determinism.
git config pack.threads 1
git repack -A -d -f
rm -f .git/config
# Garbage collect unreferenced objects.
git gc --prune=all