Where("pusher_id=? AND is_deleted=?", userID, false).
And("name <> ?", excludeBranchName).
And("repo_id = ?", repoID).
- And("updated_unix >= ?", time.Now().Add(-time.Hour*6).Unix()).
+ And("commit_time >= ?", time.Now().Add(-time.Hour*6).Unix()).
NotIn("name", subQuery).
- OrderBy("branch.updated_unix DESC").
+ OrderBy("branch.commit_time DESC").
Limit(2).
Find(&branches)
return branches, err
ctx.ServerError("GetBaseRepo", err)
return
}
- ctx.Data["RecentlyPushedNewBranches"], err = git_model.FindRecentlyPushedNewBranches(ctx, ctx.Repo.Repository.ID, ctx.Doer.ID, ctx.Repo.Repository.DefaultBranch)
- if err != nil {
- ctx.ServerError("GetRecentlyPushedBranches", err)
- return
+
+ showRecentlyPushedNewBranches := true
+ if ctx.Repo.Repository.IsMirror ||
+ !ctx.Repo.Repository.UnitEnabled(ctx, unit_model.TypePullRequests) {
+ showRecentlyPushedNewBranches = false
+ }
+ if showRecentlyPushedNewBranches {
+ ctx.Data["RecentlyPushedNewBranches"], err = git_model.FindRecentlyPushedNewBranches(ctx, ctx.Repo.Repository.ID, ctx.Doer.ID, ctx.Repo.Repository.DefaultBranch)
+ if err != nil {
+ ctx.ServerError("GetRecentlyPushedBranches", err)
+ return
+ }
}
}
{{range .RecentlyPushedNewBranches}}
<div class="ui positive message gt-df gt-ac">
<div class="gt-f1">
- {{$timeSince := TimeSince .UpdatedUnix.AsTime $.locale}}
+ {{$timeSince := TimeSince .CommitTime.AsTime $.locale}}
{{$.locale.Tr "repo.pulls.recently_pushed_new_branches" (PathEscapeSegments .Name) $timeSince | Safe}}
</div>
<a aria-role="button" class="ui compact positive button gt-m-0" href="{{$.Repository.ComposeBranchCompareURL $.Repository.BaseRepo (PathEscapeSegments .Name)}}">