1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Updates to the API for archived repos (#27149)

This commit is contained in:
JakobDev
2023-09-22 01:43:29 +02:00
committed by GitHub
parent 7520cd678c
commit 28f9b313ba
22 changed files with 249 additions and 34 deletions

View File

@@ -95,6 +95,11 @@ func (opts *ApplyDiffPatchOptions) Validate(ctx context.Context, repo *repo_mode
// ApplyDiffPatch applies a patch to the given repository
func ApplyDiffPatch(ctx context.Context, repo *repo_model.Repository, doer *user_model.User, opts *ApplyDiffPatchOptions) (*structs.FileResponse, error) {
err := repo.MustNotBeArchived()
if err != nil {
return nil, err
}
if err := opts.Validate(ctx, repo, doer); err != nil {
return nil, err
}