mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-23 23:03:34 +01:00
Use the rev-parsed sha1 commit id (#98)
Use the rev-parsed sha1 commit id in urls to repo files, instead of the abbreviated version.
This commit is contained in:
parent
92c48dabe3
commit
5a6f7edde9
1 changed files with 4 additions and 2 deletions
|
@ -9,11 +9,11 @@ import (
|
|||
"path"
|
||||
|
||||
"github.com/Unknwon/paginater"
|
||||
"github.com/go-gitea/git"
|
||||
"github.com/go-gitea/gitea/models"
|
||||
"github.com/go-gitea/gitea/modules/base"
|
||||
"github.com/go-gitea/gitea/modules/context"
|
||||
"github.com/go-gitea/gitea/modules/setting"
|
||||
"github.com/go-gitea/git"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -158,7 +158,9 @@ func Diff(ctx *context.Context) {
|
|||
}
|
||||
return
|
||||
}
|
||||
|
||||
if len(commitID) != 40 {
|
||||
commitID = commit.ID.String()
|
||||
}
|
||||
diff, err := models.GetDiffCommit(models.RepoPath(userName, repoName),
|
||||
commitID, setting.Git.MaxGitDiffLines,
|
||||
setting.Git.MaxGitDiffLineCharacters, setting.Git.MaxGitDiffFiles)
|
||||
|
|
Loading…
Reference in a new issue