aboutsummaryrefslogtreecommitdiffstats
path: root/modules/git/repo_compare.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 /modules/git/repo_compare.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 'modules/git/repo_compare.go')
-rw-r--r--modules/git/repo_compare.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/git/repo_compare.go b/modules/git/repo_compare.go
index 3255e68392..5d1208aab1 100644
--- a/modules/git/repo_compare.go
+++ b/modules/git/repo_compare.go
@@ -7,7 +7,6 @@ package git
import (
"bytes"
- "container/list"
"fmt"
"io"
"regexp"
@@ -23,7 +22,7 @@ type CompareInfo struct {
MergeBase string
BaseCommitID string
HeadCommitID string
- Commits *list.List
+ Commits []*Commit
NumFiles int
}
@@ -90,7 +89,7 @@ func (repo *Repository) GetCompareInfo(basePath, baseBranch, headBranch string)
return nil, fmt.Errorf("parsePrettyFormatLogToList: %v", err)
}
} else {
- compareInfo.Commits = list.New()
+ compareInfo.Commits = []*Commit{}
compareInfo.MergeBase, err = GetFullCommitID(repo.Path, remoteBranch)
if err != nil {
compareInfo.MergeBase = remoteBranch