Skip to content

Commit ae44e3f

Browse files
committed
Revert "feat: check branch commit"
This reverts commit baf7515.
1 parent baf7515 commit ae44e3f

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

routers/web/repo/view.go

Lines changed: 0 additions & 30 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 {
@@ -1007,8 +1006,6 @@ func renderHomeCode(ctx *context.Context) {
10071006
return
10081007
}
10091008

1010-
checkOutdatedBranch(ctx)
1011-
10121009
checkCitationFile(ctx, entry)
10131010
if ctx.Written() {
10141011
return
@@ -1075,31 +1072,6 @@ func renderHomeCode(ctx *context.Context) {
10751072
ctx.HTML(http.StatusOK, tplRepoHome)
10761073
}
10771074

1078-
func checkOutdatedBranch(ctx *context.Context) {
1079-
// get the head commit of the branch since ctx.Repo.CommitID is not always the head commit of `ctx.Repo.BranchName`
1080-
commit, err := ctx.Repo.GitRepo.GetBranchCommit(ctx.Repo.BranchName)
1081-
if err != nil {
1082-
log.Error("GetBranchCommitID: %v", err)
1083-
// Don't return an error page, as it can be rechecked the next time the user opens the page.
1084-
return
1085-
}
1086-
1087-
1088-
dbBranch, err := git_model.GetBranch(ctx, ctx.Repo.Repository.ID, ctx.Repo.BranchName)
1089-
if err != nil {
1090-
log.Error("GetBranch: %v", err)
1091-
// Don't return an error page, as it can be rechecked the next time the user opens the page.
1092-
return
1093-
}
1094-
1095-
if commit.ID.String() != dbBranch.CommitID &&
1096-
time.Since(commit.)
1097-
{
1098-
1099-
}
1100-
}
1101-
1102-
11031075
// RenderUserCards render a page show users according the input template
11041076
func RenderUserCards(ctx *context.Context, total int, getter func(opts db.ListOptions) ([]*user_model.User, error), tpl base.TplName) {
11051077
page := ctx.FormInt("page")
@@ -1175,5 +1147,3 @@ func Forks(ctx *context.Context) {
11751147

11761148
ctx.HTML(http.StatusOK, tplForks)
11771149
}
1178-
1179-

0 commit comments

Comments
 (0)