summaryrefslogtreecommitdiffstats
path: root/models/branches.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2021-04-09 09:40:34 +0200
committerGitHub <noreply@github.com>2021-04-09 09:40:34 +0200
commit9c4601bdf8369ed72944085e3952111cf4aeea11 (patch)
tree2dcadaabed6dbe14ddba2d2513b736ff6b7f089f /models/branches.go
parent0991f9aa427ab923544c35d73232fa53c9db9120 (diff)
downloadgitea-9c4601bdf8369ed72944085e3952111cf4aeea11.tar.gz
gitea-9c4601bdf8369ed72944085e3952111cf4aeea11.zip
Code Formats, Nits & Unused Func/Var deletions (#15286)
* _ to unused func options * rm useless brakets * rm trifial non used models functions * rm dead code * rm dead global vars * fix routers/api/v1/repo/issue.go * dont overload import module
Diffstat (limited to 'models/branches.go')
-rw-r--r--models/branches.go19
1 files changed, 0 insertions, 19 deletions
diff --git a/models/branches.go b/models/branches.go
index 440c093095..1ac1fa49e5 100644
--- a/models/branches.go
+++ b/models/branches.go
@@ -260,12 +260,6 @@ func (protectBranch *ProtectedBranch) IsProtectedFile(patterns []glob.Glob, path
return r
}
-// GetProtectedBranchByRepoID getting protected branch by repo ID
-func GetProtectedBranchByRepoID(repoID int64) ([]*ProtectedBranch, error) {
- protectedBranches := make([]*ProtectedBranch, 0)
- return protectedBranches, x.Where("repo_id = ?", repoID).Desc("updated_unix").Find(&protectedBranches)
-}
-
// GetProtectedBranchBy getting protected branch by ID/Name
func GetProtectedBranchBy(repoID int64, branchName string) (*ProtectedBranch, error) {
return getProtectedBranchBy(x, repoID, branchName)
@@ -283,19 +277,6 @@ func getProtectedBranchBy(e Engine, repoID int64, branchName string) (*Protected
return rel, nil
}
-// GetProtectedBranchByID getting protected branch by ID
-func GetProtectedBranchByID(id int64) (*ProtectedBranch, error) {
- rel := &ProtectedBranch{}
- has, err := x.ID(id).Get(rel)
- if err != nil {
- return nil, err
- }
- if !has {
- return nil, nil
- }
- return rel, nil
-}
-
// WhitelistOptions represent all sorts of whitelists used for protected branches
type WhitelistOptions struct {
UserIDs []int64