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/gitaly/service/repository/write_ref.go')
-rw-r--r--internal/gitaly/service/repository/write_ref.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/gitaly/service/repository/write_ref.go b/internal/gitaly/service/repository/write_ref.go
index e0a83f561..1e86f3fcd 100644
--- a/internal/gitaly/service/repository/write_ref.go
+++ b/internal/gitaly/service/repository/write_ref.go
@@ -5,6 +5,7 @@ import (
"context"
"fmt"
+ gitalyerrors "gitlab.com/gitlab-org/gitaly/v15/internal/errors"
"gitlab.com/gitlab-org/gitaly/v15/internal/git"
"gitlab.com/gitlab-org/gitaly/v15/internal/git/localrepo"
"gitlab.com/gitlab-org/gitaly/v15/internal/git/updateref"
@@ -87,6 +88,9 @@ func updateRef(ctx context.Context, repo *localrepo.Repo, req *gitalypb.WriteRef
}
func validateWriteRefRequest(req *gitalypb.WriteRefRequest) error {
+ if req.GetRepository() == nil {
+ return gitalyerrors.ErrEmptyRepository
+ }
if err := git.ValidateRevision(req.Ref); err != nil {
return fmt.Errorf("invalid ref: %v", err)
}