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

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'internal/service/remote/fetch_internal_remote.go')
-rw-r--r--internal/service/remote/fetch_internal_remote.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/internal/service/remote/fetch_internal_remote.go b/internal/service/remote/fetch_internal_remote.go
index c8eaed507..fc61d7b82 100644
--- a/internal/service/remote/fetch_internal_remote.go
+++ b/internal/service/remote/fetch_internal_remote.go
@@ -2,8 +2,10 @@ package remote
import (
"context"
+ "errors"
"fmt"
+ "gitlab.com/gitlab-org/gitaly/internal/helper"
"gitlab.com/gitlab-org/gitaly/internal/rubyserver"
"gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"
"google.golang.org/grpc/codes"
@@ -40,3 +42,14 @@ func validateFetchInternalRemoteRequest(req *gitalypb.FetchInternalRemoteRequest
return nil
}
+
+// FetchInternalRemoteErrorOnFailure fetches another Gitaly repository set as a remote
+func (s *server) FetchInternalRemoteErrorOnFailure(ctx context.Context, req *gitalypb.FetchInternalRemoteRequest) (*gitalypb.FetchInternalRemoteResponse, error) {
+ resp, err := s.FetchInternalRemote(ctx, req)
+
+ if !resp.Result {
+ return nil, helper.ErrInternal(errors.New("fetch failed"))
+ }
+
+ return resp, err
+}