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/create_repository_from_snapshot.go')
-rw-r--r--internal/gitaly/service/repository/create_repository_from_snapshot.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/gitaly/service/repository/create_repository_from_snapshot.go b/internal/gitaly/service/repository/create_repository_from_snapshot.go
index 4965fd3bb..48e2529ff 100644
--- a/internal/gitaly/service/repository/create_repository_from_snapshot.go
+++ b/internal/gitaly/service/repository/create_repository_from_snapshot.go
@@ -7,6 +7,7 @@ import (
"time"
"gitlab.com/gitlab-org/gitaly/v15/internal/command"
+ gitalyerrors "gitlab.com/gitlab-org/gitaly/v15/internal/errors"
"gitlab.com/gitlab-org/gitaly/v15/internal/helper"
"gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb"
"gitlab.com/gitlab-org/labkit/correlation"
@@ -75,6 +76,9 @@ func untar(ctx context.Context, path string, in *gitalypb.CreateRepositoryFromSn
}
func (s *server) CreateRepositoryFromSnapshot(ctx context.Context, in *gitalypb.CreateRepositoryFromSnapshotRequest) (*gitalypb.CreateRepositoryFromSnapshotResponse, error) {
+ if in.GetRepository() == nil {
+ return nil, helper.ErrInvalidArgument(gitalyerrors.ErrEmptyRepository)
+ }
if err := s.createRepository(ctx, in.GetRepository(), func(repo *gitalypb.Repository) error {
path, err := s.locator.GetPath(repo)
if err != nil {