From fb5e38dd2c82f455a8548fa68e5cd2baef6f82bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enver=20Bi=C5=A1evac?= Date: Fri, 26 Apr 2024 22:54:08 +0000 Subject: [PATCH] [code-1822-maint] add validation method to git archive params (#2016) --- git/repo.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/git/repo.go b/git/repo.go index 92c4e5580..13ed7b60a 100644 --- a/git/repo.go +++ b/git/repo.go @@ -542,8 +542,19 @@ type ArchiveParams struct { api.ArchiveParams } +func (p *ArchiveParams) Validate() error { + if err := p.ReadParams.Validate(); err != nil { + return err + } + + if err := p.ArchiveParams.Validate(); err != nil { + return err + } + return nil +} + func (s *Service) Archive(ctx context.Context, params ArchiveParams, w io.Writer) error { - if err := params.ReadParams.Validate(); err != nil { + if err := params.Validate(); err != nil { return err } repoPath := getFullPathForRepo(s.reposRoot, params.RepoUID)