summaryrefslogtreecommitdiffstats
path: root/services/repository/push.go
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2021-08-09 20:08:51 +0200
committerGitHub <noreply@github.com>2021-08-09 14:08:51 -0400
commitd9ef43a7126ab83af563c1c9b54cdf0092327b2a (patch)
treefabc9a9d24d42bb0de6dd9557c9e07e95bd5722b /services/repository/push.go
parent23d438f56524a7c3fc185df66d6d95f797a80eee (diff)
downloadgitea-d9ef43a7126ab83af563c1c9b54cdf0092327b2a.tar.gz
gitea-d9ef43a7126ab83af563c1c9b54cdf0092327b2a.zip
Replace `list.List` with slices (#16311)
* Replaced list with slice. * Fixed usage of pointer to temporary variable. * Replaced LIFO list with slice. * Lint * Removed type check. * Removed duplicated code. * Lint * Fixed merge. Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'services/repository/push.go')
-rw-r--r--services/repository/push.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/services/repository/push.go b/services/repository/push.go
index 26df6b8e45..cf7060adef 100644
--- a/services/repository/push.go
+++ b/services/repository/push.go
@@ -5,7 +5,6 @@
package repository
import (
- "container/list"
"fmt"
"time"
@@ -147,7 +146,7 @@ func pushUpdates(optsList []*repo_module.PushUpdateOptions) error {
refName := opts.RefName()
// Push new branch.
- var l *list.List
+ var l []*git.Commit
if opts.IsNewRef() {
if repo.IsEmpty { // Change default branch and empty status only if pushed ref is non-empty branch.
repo.DefaultBranch = refName
@@ -191,7 +190,7 @@ func pushUpdates(optsList []*repo_module.PushUpdateOptions) error {
}
}
- commits := repo_module.ListToPushCommits(l)
+ commits := repo_module.GitToPushCommits(l)
commits.HeadCommit = repo_module.CommitToPushCommit(newCommit)
if err := repofiles.UpdateIssuesCommit(pusher, repo, commits.Commits, refName); err != nil {