aboutsummaryrefslogtreecommitdiffstats
path: root/models/git
diff options
context:
space:
mode:
authorZettat123 <zettat123@gmail.com>2023-08-01 15:25:11 +0800
committerGitHub <noreply@github.com>2023-08-01 07:25:11 +0000
commit9a65d011f6b289dd6e7acb18a4b86c51d4d388ee (patch)
treec9a315d6c90593799a8691f251ec51f728de18b6 /models/git
parentb9baed2c74286710481886c5d1f3010e43840012 (diff)
downloadgitea-9a65d011f6b289dd6e7acb18a4b86c51d4d388ee.tar.gz
gitea-9a65d011f6b289dd6e7acb18a4b86c51d4d388ee.zip
Some fixes of the prompt of new branches (#26257)
Related to #26239 This PR makes some fixes: - do not show the prompt for mirror repos and repos with pull request units disabled - use `commit_time` instead of `updated_unix`, as `commit_time` is the real time when the branch was pushed
Diffstat (limited to 'models/git')
-rw-r--r--models/git/branch.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/models/git/branch.go b/models/git/branch.go
index c68da1be78..6d50fb9fb6 100644
--- a/models/git/branch.go
+++ b/models/git/branch.go
@@ -395,9 +395,9 @@ func FindRecentlyPushedNewBranches(ctx context.Context, repoID, userID int64, ex
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