Skip to content

Commit

Permalink
Remove the push_test since the function has been removed.
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny committed Dec 5, 2020
1 parent 19b4e3a commit af12f40
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 146 deletions.
14 changes: 7 additions & 7 deletions services/repository/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,6 @@ func pushUpdates(optsList []*repo_module.PushUpdateOptions) error {
// Push new branch.
var l *list.List
if opts.IsNewRef() {
l, err = newCommit.CommitsBeforeLimit(10)
if err != nil {
return fmt.Errorf("newCommit.CommitsBeforeLimit: %v", err)
}
notification.NotifyCreateRef(pusher, repo, "branch", opts.RefFullName)
} else {
if repo.IsEmpty { // Change default branch and empty status only if pushed ref is non-empty branch.
repo.DefaultBranch = refName
repo.IsEmpty = false
Expand All @@ -150,6 +144,12 @@ func pushUpdates(optsList []*repo_module.PushUpdateOptions) error {
}
}

l, err = newCommit.CommitsBeforeLimit(10)
if err != nil {
return fmt.Errorf("newCommit.CommitsBeforeLimit: %v", err)
}
notification.NotifyCreateRef(pusher, repo, "branch", opts.RefFullName)
} else {
l, err = newCommit.CommitsBeforeUntil(opts.OldCommitID)
if err != nil {
return fmt.Errorf("newCommit.CommitsBeforeUntil: %v", err)
Expand All @@ -170,11 +170,11 @@ func pushUpdates(optsList []*repo_module.PushUpdateOptions) error {
}
}

commits = repo_module.ListToPushCommits(l)
if len(commits.Commits) > setting.UI.FeedMaxCommitNum {
commits.Commits = commits.Commits[:setting.UI.FeedMaxCommitNum]
}
commits.CompareURL = repo.ComposeCompareURL(opts.OldCommitID, opts.NewCommitID)
commits = repo_module.ListToPushCommits(l)
notification.NotifyPushCommits(pusher, repo, opts, commits)

if err := repofiles.UpdateIssuesCommit(pusher, repo, commits.Commits, refName); err != nil {
Expand Down
139 changes: 0 additions & 139 deletions services/repository/push_test.go

This file was deleted.

0 comments on commit af12f40

Please sign in to comment.