mirror of
https://github.com/harness/drone.git
synced 2025-05-21 11:29:52 +08:00
Adding Semantic Search (#418)
This commit is contained in:
parent
ef4855e901
commit
631fa84180
@ -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)
|
||||||
|
@ -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
|
||||||
|
@ -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)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user