Skip to content

Commit

Permalink
Use the rev-parsed sha1 commit id
Browse files Browse the repository at this point in the history
Use the rev-parsed sha1 commit id in urls to repo files,
instead of the abbreviated version.
  • Loading branch information
odinuge committed Nov 6, 2016
1 parent 92c48da commit 0962a07
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions routers/repo/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 0962a07

Please sign in to comment.