diff options
Diffstat (limited to 'workhorse/internal/git/blob.go')
-rw-r--r-- | workhorse/internal/git/blob.go | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/workhorse/internal/git/blob.go b/workhorse/internal/git/blob.go index 39bd4490e66..06b0eb08228 100644 --- a/workhorse/internal/git/blob.go +++ b/workhorse/internal/git/blob.go @@ -8,7 +8,7 @@ import ( "gitlab.com/gitlab-org/gitlab/workhorse/internal/api" "gitlab.com/gitlab-org/gitlab/workhorse/internal/gitaly" - "gitlab.com/gitlab-org/gitlab/workhorse/internal/helper" + "gitlab.com/gitlab-org/gitlab/workhorse/internal/helper/fail" "gitlab.com/gitlab-org/gitlab/workhorse/internal/senddata" ) @@ -23,24 +23,20 @@ var SendBlob = &blob{"git-blob:"} func (b *blob) Inject(w http.ResponseWriter, r *http.Request, sendData string) { var params blobParams if err := b.Unpack(¶ms, sendData); err != nil { - helper.Fail500(w, r, fmt.Errorf("SendBlob: unpack sendData: %v", err)) + fail.Request(w, r, fmt.Errorf("SendBlob: unpack sendData: %v", err)) return } - ctx, blobClient, err := gitaly.NewBlobClient( - r.Context(), - params.GitalyServer, - gitaly.WithFeatures(params.GitalyServer.Features), - ) + ctx, blobClient, err := gitaly.NewBlobClient(r.Context(), params.GitalyServer) if err != nil { - helper.Fail500(w, r, fmt.Errorf("blob.GetBlob: %v", err)) + fail.Request(w, r, fmt.Errorf("blob.GetBlob: %v", err)) return } setBlobHeaders(w) if err := blobClient.SendBlob(ctx, w, ¶ms.GetBlobRequest); err != nil { - helper.Fail500(w, r, fmt.Errorf("blob.GetBlob: %v", err)) + fail.Request(w, r, fmt.Errorf("blob.GetBlob: %v", err)) return } } |