Skip to content

go-git/go-git-fixtures

go-git-fixtures GoDoc Test OpenSSF Scorecard

git repository fixtures used by go-git

Adding new Fixtures

Adding new pack fixtures

  1. 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/
  1. Copy them into /data.
  2. Add a new entry in fixtures.go:
{
	Tags:         []string{"packfile", "<TAG_TO_REFER_TO>"},
	PackfileHash: "<PACK_HASH>",
}

Adding new dot fixtures

  1. 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 .
  1. Get the sha1 of the file: shasum < git-.tgz.
  2. Move the file using the checksum to data/git-<checksum>.tgz
  3. Add a new entry in fixtures.go:
{
	Tags:         []string{"packfile", "<TAG_TO_REFER_TO>"},
	PackfileHash: "<PACK_HASH>",
}

About

Several git fixtures to run go-git tests

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors 20