git repository fixtures used by go-git
- Get the
.idx
and.pack
files from the repository:
git clone https://<repository>
cd <repository_name>
git checkout <REF>
git gc
ls .git/objects/pack/
- Copy them into
/data
. - Add a new entry in
fixtures.go
:
{
Tags: []string{"packfile", "<TAG_TO_REFER_TO>"},
PackfileHash: "<PACK_HASH>",
}
- Tarball the contents of .git from a git repository:
git clone https://<repository>
cd <repository_name>
git checkout <REF>
git gc
tar -czf git.tgz -C .git .
- Get the sha1 of the file:
shasum < git-.tgz
. - Move the file using the checksum to
data/git-<checksum>.tgz
- Add a new entry in
fixtures.go
:
{
Tags: []string{"packfile", "<TAG_TO_REFER_TO>"},
PackfileHash: "<PACK_HASH>",
}