1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-23 02:38:35 +00:00

Feature: Archive repos (#5009)

This commit is contained in:
kolaente
2019-01-23 19:58:38 +01:00
committed by techknowlogick
parent 6ad834e236
commit 0b510725c9
30 changed files with 437 additions and 244 deletions

View File

@@ -95,6 +95,12 @@ func HTTP(ctx *context.Context) {
return
}
// Don't allow pushing if the repo is archived
if repo.IsArchived && !isPull {
ctx.HandleText(http.StatusForbidden, "This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.")
return
}
// Only public pull don't need auth.
isPublicPull := !repo.IsPrivate && isPull
var (