aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/idxfile/idxfile.go
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing/format/idxfile/idxfile.go')
-rw-r--r--plumbing/format/idxfile/idxfile.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/plumbing/format/idxfile/idxfile.go b/plumbing/format/idxfile/idxfile.go
index 5a718f3..b9bb1c2 100644
--- a/plumbing/format/idxfile/idxfile.go
+++ b/plumbing/format/idxfile/idxfile.go
@@ -21,6 +21,10 @@ type Idxfile struct {
IdxChecksum [20]byte
}
+func NewIdxfile() *Idxfile {
+ return &Idxfile{}
+}
+
// Entry is the in memory representation of an object entry in the idx file.
type Entry struct {
Hash plumbing.Hash
@@ -30,7 +34,7 @@ type Entry struct {
// Add adds a new Entry with the given values to the Idxfile.
func (idx *Idxfile) Add(h plumbing.Hash, offset uint64, crc32 uint32) {
- idx.Entries = append(idx.Entries, Entry{
+ idx.Entries = append(idx.Entries, &Entry{
Hash: h,
Offset: offset,
CRC32: crc32,