From c64eb817d5e5cbaec10dea1342e1ec95721e886b Mon Sep 17 00:00:00 2001 From: "Santiago M. Mola" Date: Tue, 25 Jul 2017 10:08:36 +0200 Subject: packfile: create packfile.Index and reuse it There was an internal type (i.e. storage/filesystem.idx) to use as in-memory index for packfiles. This was not convenient to reuse in the packfile. This commit creates a new representation (format/packfile.Index) that can be converted to and from idxfile.Idxfile. A packfile.Index now contains the functionality that was scattered on storage/filesystem.idx and packfile.Decoder's internals. storage/filesystem now reuses packfile.Index instances and this also results in higher cache hit ratios when resolving deltas. --- plumbing/format/idxfile/encoder_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plumbing/format/idxfile/encoder_test.go') diff --git a/plumbing/format/idxfile/encoder_test.go b/plumbing/format/idxfile/encoder_test.go index 1fc4e9c..d566b0d 100644 --- a/plumbing/format/idxfile/encoder_test.go +++ b/plumbing/format/idxfile/encoder_test.go @@ -1,4 +1,4 @@ -package idxfile +package idxfile_test import ( "bytes" @@ -6,6 +6,7 @@ import ( "github.com/src-d/go-git-fixtures" "gopkg.in/src-d/go-git.v4/plumbing" + . "gopkg.in/src-d/go-git.v4/plumbing/format/idxfile" . "gopkg.in/check.v1" ) -- cgit