@@ -450,7 +450,7 @@ func RenameBranch(ctx context.Context, repo *repo_model.Repository, from, to str
450450type FindRecentlyPushedNewBranchesOptions struct {
451451 Repo * repo_model.Repository
452452 BaseRepo * repo_model.Repository
453- CommitAfterUnix int64
453+ PushedAfterUnix int64
454454 MaxCount int
455455}
456456
@@ -460,11 +460,11 @@ type RecentlyPushedNewBranch struct {
460460 BranchDisplayName string
461461 BranchLink string
462462 BranchCompareURL string
463- CommitTime timeutil.TimeStamp
463+ PushedTime timeutil.TimeStamp
464464}
465465
466466// FindRecentlyPushedNewBranches return at most 2 new branches pushed by the user in 2 hours which has no opened PRs created
467- // if opts.CommitAfterUnix is 0, we will find the branches that were committed to in the last 2 hours
467+ // if opts.PushedAfterUnix is 0, we will find the branches that were pushed in the last 2 hours
468468// if opts.ListOptions is not set, we will only display top 2 latest branches.
469469// Protected branches will be skipped since they are unlikely to be used to create new PRs.
470470func FindRecentlyPushedNewBranches (ctx context.Context , doer * user_model.User , opts FindRecentlyPushedNewBranchesOptions ) ([]* RecentlyPushedNewBranch , error ) {
@@ -492,8 +492,8 @@ func FindRecentlyPushedNewBranches(ctx context.Context, doer *user_model.User, o
492492 }
493493 repoIDs := builder .Select ("id" ).From ("repository" ).Where (repoCond )
494494
495- if opts .CommitAfterUnix == 0 {
496- opts .CommitAfterUnix = time .Now ().Add (- time .Hour * 2 ).Unix ()
495+ if opts .PushedAfterUnix == 0 {
496+ opts .PushedAfterUnix = time .Now ().Add (- time .Hour * 2 ).Unix ()
497497 }
498498
499499 var ignoredCommitIDs []string
@@ -522,7 +522,7 @@ func FindRecentlyPushedNewBranches(ctx context.Context, doer *user_model.User, o
522522 "pusher_id" : doer .ID ,
523523 "is_deleted" : false ,
524524 },
525- builder.Gte {"commit_time " : opts .CommitAfterUnix },
525+ builder.Gte {"updated_unix " : opts .PushedAfterUnix },
526526 builder .In ("repo_id" , repoIDs ),
527527 // newly created branch have no changes, so skip them
528528 builder .NotIn ("commit_id" , ignoredCommitIDs ),
@@ -573,7 +573,7 @@ func FindRecentlyPushedNewBranches(ctx context.Context, doer *user_model.User, o
573573 BranchName : branch .Name ,
574574 BranchLink : fmt .Sprintf ("%s/src/branch/%s" , branch .Repo .Link (), util .PathEscapeSegments (branch .Name )),
575575 BranchCompareURL : branch .Repo .ComposeBranchCompareURL (opts .BaseRepo , baseTargetBranchName , branch .Name ),
576- CommitTime : branch .CommitTime ,
576+ PushedTime : branch .UpdatedUnix ,
577577 })
578578 }
579579 if len (newBranches ) == opts .MaxCount {
0 commit comments