Skip to content

Commit af12f40

Browse files
committed
Remove the push_test since the function has been removed.
1 parent 19b4e3a commit af12f40

File tree

2 files changed

+7
-146
lines changed

2 files changed

+7
-146
lines changed

services/repository/push.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,6 @@ func pushUpdates(optsList []*repo_module.PushUpdateOptions) error {
128128
// Push new branch.
129129
var l *list.List
130130
if opts.IsNewRef() {
131-
l, err = newCommit.CommitsBeforeLimit(10)
132-
if err != nil {
133-
return fmt.Errorf("newCommit.CommitsBeforeLimit: %v", err)
134-
}
135-
notification.NotifyCreateRef(pusher, repo, "branch", opts.RefFullName)
136-
} else {
137131
if repo.IsEmpty { // Change default branch and empty status only if pushed ref is non-empty branch.
138132
repo.DefaultBranch = refName
139133
repo.IsEmpty = false
@@ -150,6 +144,12 @@ func pushUpdates(optsList []*repo_module.PushUpdateOptions) error {
150144
}
151145
}
152146

147+
l, err = newCommit.CommitsBeforeLimit(10)
148+
if err != nil {
149+
return fmt.Errorf("newCommit.CommitsBeforeLimit: %v", err)
150+
}
151+
notification.NotifyCreateRef(pusher, repo, "branch", opts.RefFullName)
152+
} else {
153153
l, err = newCommit.CommitsBeforeUntil(opts.OldCommitID)
154154
if err != nil {
155155
return fmt.Errorf("newCommit.CommitsBeforeUntil: %v", err)
@@ -170,11 +170,11 @@ func pushUpdates(optsList []*repo_module.PushUpdateOptions) error {
170170
}
171171
}
172172

173+
commits = repo_module.ListToPushCommits(l)
173174
if len(commits.Commits) > setting.UI.FeedMaxCommitNum {
174175
commits.Commits = commits.Commits[:setting.UI.FeedMaxCommitNum]
175176
}
176177
commits.CompareURL = repo.ComposeCompareURL(opts.OldCommitID, opts.NewCommitID)
177-
commits = repo_module.ListToPushCommits(l)
178178
notification.NotifyPushCommits(pusher, repo, opts, commits)
179179

180180
if err := repofiles.UpdateIssuesCommit(pusher, repo, commits.Commits, refName); err != nil {

services/repository/push_test.go

Lines changed: 0 additions & 139 deletions
This file was deleted.

0 commit comments

Comments
 (0)