Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'workhorse/internal/git/snapshot.go')
-rw-r--r--workhorse/internal/git/snapshot.go16
1 files changed, 6 insertions, 10 deletions
diff --git a/workhorse/internal/git/snapshot.go b/workhorse/internal/git/snapshot.go
index 70832ec9211..777ecd144a8 100644
--- a/workhorse/internal/git/snapshot.go
+++ b/workhorse/internal/git/snapshot.go
@@ -9,7 +9,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/log"
"gitlab.com/gitlab-org/gitlab/workhorse/internal/senddata"
)
@@ -31,30 +31,26 @@ func (s *snapshot) Inject(w http.ResponseWriter, r *http.Request, sendData strin
var params snapshotParams
if err := s.Unpack(&params, sendData); err != nil {
- helper.Fail500(w, r, fmt.Errorf("SendSnapshot: unpack sendData: %v", err))
+ fail.Request(w, r, fmt.Errorf("SendSnapshot: unpack sendData: %v", err))
return
}
request := &gitalypb.GetSnapshotRequest{}
if err := gitaly.UnmarshalJSON(params.GetSnapshotRequest, request); err != nil {
- helper.Fail500(w, r, fmt.Errorf("SendSnapshot: unmarshal GetSnapshotRequest: %v", err))
+ fail.Request(w, r, fmt.Errorf("SendSnapshot: unmarshal GetSnapshotRequest: %v", err))
return
}
- ctx, c, err := gitaly.NewRepositoryClient(
- r.Context(),
- params.GitalyServer,
- gitaly.WithFeatures(params.GitalyServer.Features),
- )
+ ctx, c, err := gitaly.NewRepositoryClient(r.Context(), params.GitalyServer)
if err != nil {
- helper.Fail500(w, r, fmt.Errorf("SendSnapshot: gitaly.NewRepositoryClient: %v", err))
+ fail.Request(w, r, fmt.Errorf("SendSnapshot: gitaly.NewRepositoryClient: %v", err))
return
}
reader, err := c.SnapshotReader(ctx, request)
if err != nil {
- helper.Fail500(w, r, fmt.Errorf("SendSnapshot: client.SnapshotReader: %v", err))
+ fail.Request(w, r, fmt.Errorf("SendSnapshot: client.SnapshotReader: %v", err))
return
}