Skip to content

Commit

Permalink
Merge remote-tracking branch 'giteaofficial/main'
Browse files Browse the repository at this point in the history
* giteaofficial/main:
  Update base.go (go-gitea#19739)
  [doctor] do not update User Stars numbers unless --fix (go-gitea#19750)
  Fix incorrect translation key (go-gitea#19744)
  Improved ref comment link when origin is body/title (go-gitea#19741)
  [doctor] explain what enable-push-options does (go-gitea#19740)
  • Loading branch information
zjjhot committed May 19, 2022
2 parents 33fd77b + 3e5ea9a commit 748ae8f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
3 changes: 2 additions & 1 deletion models/issue_xref.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,9 @@ func CommentTypeIsRef(t CommentType) bool {

// RefCommentHTMLURL returns the HTML URL for the comment that created this reference
func (comment *Comment) RefCommentHTMLURL() string {
// Edge case for when the reference is inside the title or the description of the referring issue
if comment.RefCommentID == 0 {
return ""
return comment.RefIssueHTMLURL()
}
if err := comment.LoadRefComment(); err != nil { // Silently dropping errors :unamused:
log.Error("LoadRefComment(%d): %v", comment.RefCommentID, err)
Expand Down
2 changes: 1 addition & 1 deletion models/unit/unit.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ var (
TypePackages,
"repo.packages",
"/packages",
"repo.packages.desc",
"packages.desc",
6,
perm.AccessModeRead,
}
Expand Down
13 changes: 9 additions & 4 deletions modules/doctor/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,14 @@ func checkHooks(ctx context.Context, logger log.Logger, autofix bool) error {
}

func checkUserStarNum(ctx context.Context, logger log.Logger, autofix bool) error {
if err := models.DoctorUserStarNum(); err != nil {
logger.Critical("Unable update User Stars numbers")
return err
if autofix {
if err := models.DoctorUserStarNum(); err != nil {
logger.Critical("Unable update User Stars numbers")
return err
}
logger.Info("Updated User Stars numbers.")
} else {
logger.Info("No check available for User Stars numbers (skipped)")
}
return nil
}
Expand Down Expand Up @@ -207,7 +212,7 @@ func init() {
Priority: 6,
})
Register(&Check{
Title: "Enable push options",
Title: "Check that all git repositories have receive.advertisePushOptions set to true",
Name: "enable-push-options",
IsDefault: false,
Run: checkEnablePushOptions,
Expand Down
2 changes: 1 addition & 1 deletion routers/web/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func storageHandler(storageSetting setting.Storage, prefix string, objStore stor
w,
req,
u.String(),
http.StatusPermanentRedirect,
http.StatusTemporaryRedirect,
)
})
}
Expand Down

0 comments on commit 748ae8f

Please sign in to comment.