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

Add golangci (#6418)

This commit is contained in:
kolaente
2019-06-12 21:41:28 +02:00
committed by techknowlogick
parent 5832f8d90d
commit f9ec2f89f2
147 changed files with 1046 additions and 774 deletions

View File

@@ -53,11 +53,9 @@ func DeleteRepoFile(repo *models.Repository, doer *models.User, opts *DeleteRepo
BranchName: opts.NewBranch,
}
}
} else {
if protected, _ := repo.IsProtectedBranchForPush(opts.OldBranch, doer); protected {
return nil, models.ErrUserCannotCommit{
UserName: doer.LowerName,
}
} else if protected, _ := repo.IsProtectedBranchForPush(opts.OldBranch, doer); protected {
return nil, models.ErrUserCannotCommit{
UserName: doer.LowerName,
}
}
@@ -74,10 +72,10 @@ func DeleteRepoFile(repo *models.Repository, doer *models.User, opts *DeleteRepo
author, committer := GetAuthorAndCommitterUsers(opts.Committer, opts.Author, doer)
t, err := NewTemporaryUploadRepository(repo)
defer t.Close()
if err != nil {
return nil, err
}
defer t.Close()
if err := t.Clone(opts.OldBranch); err != nil {
return nil, err
}