diff options
author | Jacob Vosmaer <jacob@gitlab.com> | 2018-06-25 12:43:42 +0300 |
---|---|---|
committer | Jacob Vosmaer <jacob@gitlab.com> | 2018-06-25 12:43:42 +0300 |
commit | 9c7d5aa98a824224fb00d842eefee957fdd67d1f (patch) | |
tree | 55354d064cbcce6f452978dcce4bc118dcf4a8a4 /internal/git | |
parent | 309d746aa6d3f5aaaf491e278c6305b1d553f9e7 (diff) |
Use catfile for all Go commit lookups
Diffstat (limited to 'internal/git')
-rw-r--r-- | internal/git/log/commit.go | 5 | ||||
-rw-r--r-- | internal/git/log/log.go | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/internal/git/log/commit.go b/internal/git/log/commit.go index 4746dbcf0..a2136c925 100644 --- a/internal/git/log/commit.go +++ b/internal/git/log/commit.go @@ -25,10 +25,11 @@ func GetCommit(ctx context.Context, repo *pb.Repository, revision string) (*pb.G return nil, err } - return getCommitCatfile(c, revision) + return GetCommitCatfile(c, revision) } -func getCommitCatfile(c *catfile.Batch, revision string) (*pb.GitCommit, error) { +// GetCommitCatfile looks up a commit by revision using an existing *catfile.Batch instance. +func GetCommitCatfile(c *catfile.Batch, revision string) (*pb.GitCommit, error) { info, err := c.Info(revision) if err != nil { if catfile.IsNotFound(err) { diff --git a/internal/git/log/log.go b/internal/git/log/log.go index b3196f68a..cd2e917dc 100644 --- a/internal/git/log/log.go +++ b/internal/git/log/log.go @@ -43,7 +43,7 @@ func (parser *Parser) Parse() bool { commitId := parser.scanner.Text() - commit, err := getCommitCatfile(parser.c, commitId) + commit, err := GetCommitCatfile(parser.c, commitId) if err != nil { parser.err = err return false |