Skip to content

Commit f9ff7ce

Browse files
authored
Merge pull request #45 from pjbgf/sha256
Add `.git-sha256` fixture
2 parents 68f85a7 + 9906b15 commit f9ff7ce

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,27 @@ ls .git/objects/pack/
2626
PackfileHash: "<PACK_HASH>",
2727
}
2828
```
29+
30+
### Adding new dot fixtures
31+
32+
1. Tarball the contents of .git from a git repository:
33+
34+
```sh
35+
git clone https://<repository>
36+
cd <repository_name>
37+
git checkout <REF>
38+
git gc
39+
40+
tar -czf git.tgz -C .git .
41+
```
42+
43+
2. Get the sha1 of the file: `shasum < git-.tgz`.
44+
3. Move the file using the checksum to `data/git-<checksum>.tgz`
45+
4. Add a new entry in `fixtures.go`:
46+
47+
```
48+
{
49+
Tags: []string{"packfile", "<TAG_TO_REFER_TO>"},
50+
PackfileHash: "<PACK_HASH>",
51+
}
52+
```
99.8 KB
Binary file not shown.

fixtures.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,10 @@ var fixtures = Fixtures{{
193193
}, {
194194
Tags: []string{"packfile", "notes"},
195195
PackfileHash: "bc4b855a55cae7703c023d4e36e3a7c9f5d84491",
196+
}, {
197+
Tags: []string{".git-sha256"},
198+
URL: "https://gitlab.com/pjbgf/sha256.git",
199+
DotGitHash: "40143428b59fe03546fabba0603268bba3b3c58b",
196200
}}
197201

198202
func All() Fixtures {

fixtures_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func TestAll(t *testing.T) {
7373
t.Parallel()
7474
fs := fixtures.All()
7575

76-
assert.Len(t, fs, 38)
76+
assert.Len(t, fs, 39)
7777
}
7878

7979
func TestByTag(t *testing.T) {

0 commit comments

Comments
 (0)