diff options
author | 6543 <6543@obermui.de> | 2020-03-01 23:05:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-02 00:05:44 +0200 |
commit | 4160bd6ef1e70f3e6ec6bb69b1cd37a66f14c4e3 (patch) | |
tree | 104077af60eb5e8d756da5d0c7a12f6e19ef3133 /models | |
parent | c08c975d368771237d6509df915d3ec315186612 (diff) | |
download | gitea-4160bd6ef1e70f3e6ec6bb69b1cd37a66f14c4e3.tar.gz gitea-4160bd6ef1e70f3e6ec6bb69b1cd37a66f14c4e3.zip |
Remove Unused Functions (#10516)
* remove ReplaceLeft
* remove GetRepositoryByOwnerAndName chainload to models.GetRepositoryByOwnerAndName
* remove CheckUnitUser chainload to models.CheckUnitUser
* remove MakeAssigneeList
* remove DownloadDiff & DownloadPatch -> DownloadDiffOrPatch
* remove GetRandomBytesAsBase64
* remove PushUpdateDeleteTags
* remove GetUserByKeyID
(you still can resolve user by "k, err := GetPublicKeyByID; userID := k.OwnerID")
* remove BasicAuthEncode from struct package -> same function in modules/base/tools !
* remove UserID from api.utils
* remove unused func from structs package
Diffstat (limited to 'models')
-rw-r--r-- | models/issue_assignees.go | 17 | ||||
-rw-r--r-- | models/update.go | 14 | ||||
-rw-r--r-- | models/user.go | 15 |
3 files changed, 0 insertions, 46 deletions
diff --git a/models/issue_assignees.go b/models/issue_assignees.go index 577ed860f3..05e1797c19 100644 --- a/models/issue_assignees.go +++ b/models/issue_assignees.go @@ -81,23 +81,6 @@ func isUserAssignedToIssue(e Engine, issue *Issue, user *User) (isAssigned bool, return e.Get(&IssueAssignees{IssueID: issue.ID, AssigneeID: user.ID}) } -// MakeAssigneeList concats a string with all names of the assignees. Useful for logs. -func MakeAssigneeList(issue *Issue) (assigneeList string, err error) { - err = issue.loadAssignees(x) - if err != nil { - return "", err - } - - for in, assignee := range issue.Assignees { - assigneeList += assignee.Name - - if len(issue.Assignees) > (in + 1) { - assigneeList += ", " - } - } - return -} - // ClearAssigneeByUserID deletes all assignments of an user func clearAssigneeByUserID(sess *xorm.Session, userID int64) (err error) { _, err = sess.Delete(&IssueAssignees{AssigneeID: userID}) diff --git a/models/update.go b/models/update.go index 8e18450db7..421c44bb40 100644 --- a/models/update.go +++ b/models/update.go @@ -9,20 +9,6 @@ import ( "strings" ) -// PushUpdateDeleteTags updates a number of delete tags -func PushUpdateDeleteTags(repo *Repository, tags []string) error { - sess := x.NewSession() - defer sess.Close() - if err := sess.Begin(); err != nil { - return fmt.Errorf("Unable to begin sess in PushUpdateDeleteTags: %v", err) - } - if err := pushUpdateDeleteTags(sess, repo, tags); err != nil { - return err - } - - return sess.Commit() -} - // PushUpdateDeleteTagsContext updates a number of delete tags with context func PushUpdateDeleteTagsContext(ctx DBContext, repo *Repository, tags []string) error { return pushUpdateDeleteTags(ctx.e, repo, tags) diff --git a/models/user.go b/models/user.go index 30ede2373e..f91ffa7169 100644 --- a/models/user.go +++ b/models/user.go @@ -1315,21 +1315,6 @@ func UserPath(userName string) string { return filepath.Join(setting.RepoRootPath, strings.ToLower(userName)) } -// GetUserByKeyID get user information by user's public key id -func GetUserByKeyID(keyID int64) (*User, error) { - var user User - has, err := x.Join("INNER", "public_key", "`public_key`.owner_id = `user`.id"). - Where("`public_key`.id=?", keyID). - Get(&user) - if err != nil { - return nil, err - } - if !has { - return nil, ErrUserNotExist{0, "", keyID} - } - return &user, nil -} - func getUserByID(e Engine, id int64) (*User, error) { u := new(User) has, err := e.ID(id).Get(u) |