Skip to content
Snippets Groups Projects
Commit 15732fa0 authored by Nick Thomas's avatar Nick Thomas
Browse files

Return BuildBlob() to function from method

parent d854d074
No related branches found
No related tags found
1 merge request!1Initial implementation of an elasticsearch indexer in Go
Loading
Loading
@@ -58,9 +58,7 @@ func GenerateBlobID(parentID, filename string) string {
return fmt.Sprintf("%s_%s", parentID, filename)
}
 
func (i *Indexer) BuildBlob(file *git.File, commitSHA string) (*Blob, error) {
parentID := i.Submitter.ParentID()
func BuildBlob(file *git.File, parentID, commitSHA string) (*Blob, error) {
if file.Size > maxBlobSize {
return nil, skipTooLargeBlob
}
Loading
Loading
Loading
Loading
@@ -31,7 +31,7 @@ func (i *Indexer) SubmitCommit(c *git.Commit) error {
func (i *Indexer) SubmitBlob(f *git.File, _, toCommit string) error {
// FIXME(nick): Not sure commitSHA is right, or how it works at all
 
blob, err := i.BuildBlob(f, toCommit)
blob, err := BuildBlob(f, i.Submitter.ParentID(), toCommit)
if err != nil {
if isSkipBlobErr(err) {
return nil
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment