Adding Semantic Search (#418)

This commit is contained in:
Johannes Batzill 2023-09-13 01:44:20 +00:00 committed by Harness
parent ef4855e901
commit 631fa84180
3 changed files with 5 additions and 5 deletions

View File

@ -108,7 +108,7 @@ func (c *Controller) GetContent(ctx context.Context,
IncludeLatestCommit: includeLatestCommit, IncludeLatestCommit: includeLatestCommit,
}) })
if err != nil { if err != nil {
return nil, err return nil, fmt.Errorf("failed to read tree node: %w", err)
} }
info, err := mapToContentInfo(treeNodeOutput.Node, treeNodeOutput.Commit, includeLatestCommit) info, err := mapToContentInfo(treeNodeOutput.Node, treeNodeOutput.Commit, includeLatestCommit)

View File

@ -42,7 +42,7 @@ func (c *Controller) Raw(ctx context.Context,
IncludeLatestCommit: false, IncludeLatestCommit: false,
}) })
if err != nil { if err != nil {
return nil, 0, err return nil, 0, fmt.Errorf("failed to read tree node: %w", err)
} }
// viewing Raw content is only supported for blob content // viewing Raw content is only supported for blob content

View File

@ -7,7 +7,7 @@ package file
import ( import (
"context" "context"
"fmt" "fmt"
"io/ioutil" "io"
"github.com/harness/gitness/gitrpc" "github.com/harness/gitness/gitrpc"
"github.com/harness/gitness/types" "github.com/harness/gitness/types"
@ -37,7 +37,7 @@ func (f *service) Get(
IncludeLatestCommit: false, IncludeLatestCommit: false,
}) })
if err != nil { if err != nil {
return nil, err return nil, fmt.Errorf("failed to read tree node: %w", err)
} }
// viewing Raw content is only supported for blob content // viewing Raw content is only supported for blob content
if treeNodeOutput.Node.Type != gitrpc.TreeNodeTypeBlob { if treeNodeOutput.Node.Type != gitrpc.TreeNodeTypeBlob {
@ -53,7 +53,7 @@ func (f *service) Get(
return nil, fmt.Errorf("failed to read blob from gitrpc: %w", err) return nil, fmt.Errorf("failed to read blob from gitrpc: %w", err)
} }
buf, err := ioutil.ReadAll(blobReader.Content) buf, err := io.ReadAll(blobReader.Content)
if err != nil { if err != nil {
return nil, fmt.Errorf("could not read blob content from file: %w", err) return nil, fmt.Errorf("could not read blob content from file: %w", err)
} }