Skip to content

Commit 0f04a69

Browse files
committed
fix: show warning
1 parent 5068c8a commit 0f04a69

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

options/locale/locale_en-US.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2591,6 +2591,7 @@ find_file.no_matching = No matching file found
25912591
error.csv.too_large = Can't render this file because it is too large.
25922592
error.csv.unexpected = Can't render this file because it contains an unexpected character in line %d and column %d.
25932593
error.csv.invalid_field_count = Can't render this file because it has a wrong number of fields in line %d.
2594+
error.broken_git_hook = Git hooks of this repository seem to be broken. Please follow the <a target="_blank" rel="noreferrer" href="https://docs.gitea.com/help/faq#push-hook--webhook-arent-running">documentation</a> to fix them, then push/merge to the default branch to refresh the status.
25942595
25952596
[graphs]
25962597
component_loading = Loading %s...

routers/web/repo/view.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,6 @@ func checkCitationFile(ctx *context.Context, entry *git.TreeEntry) {
768768
}
769769
}
770770

771-
772771
// Home render repository home page
773772
func Home(ctx *context.Context) {
774773
if setting.Other.EnableFeed {
@@ -1084,22 +1083,18 @@ func checkOutdatedBranch(ctx *context.Context) {
10841083
return
10851084
}
10861085

1087-
10881086
dbBranch, err := git_model.GetBranch(ctx, ctx.Repo.Repository.ID, ctx.Repo.BranchName)
10891087
if err != nil {
10901088
log.Error("GetBranch: %v", err)
10911089
// Don't return an error page, as it can be rechecked the next time the user opens the page.
10921090
return
10931091
}
10941092

1095-
if commit.ID.String() != dbBranch.CommitID &&
1096-
time.Since(commit.)
1097-
{
1098-
1093+
if dbBranch.CommitID != commit.ID.String() {
1094+
ctx.Flash.Warning(ctx.Tr("repo.error.broken_git_hook"), true)
10991095
}
11001096
}
11011097

1102-
11031098
// RenderUserCards render a page show users according the input template
11041099
func RenderUserCards(ctx *context.Context, total int, getter func(opts db.ListOptions) ([]*user_model.User, error), tpl base.TplName) {
11051100
page := ctx.FormInt("page")
@@ -1175,5 +1170,3 @@ func Forks(ctx *context.Context) {
11751170

11761171
ctx.HTML(http.StatusOK, tplForks)
11771172
}
1178-
1179-

0 commit comments

Comments
 (0)