Skip to content

Commit 55ef41f

Browse files
committed
Add .git-sha256 fixture
Signed-off-by: Paulo Gomes <[email protected]>
1 parent 68f85a7 commit 55ef41f

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-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: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,12 @@ var fixtures = Fixtures{{
193193
}, {
194194
Tags: []string{"packfile", "notes"},
195195
PackfileHash: "bc4b855a55cae7703c023d4e36e3a7c9f5d84491",
196-
}}
196+
}, {
197+
Tags: []string{".git-sha256"},
198+
URL: "https://gitlab.com/pjbgf/sha256.git",
199+
DotGitHash: "40143428b59fe03546fabba0603268bba3b3c58b",
200+
},
201+
}
197202

198203
func All() Fixtures {
199204
all := make(Fixtures, 0, len(fixtures))

0 commit comments

Comments
 (0)