summaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/repo.go')
-rw-r--r--models/repo.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/models/repo.go b/models/repo.go
index f51396c5ca..307f86cb25 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -98,7 +98,7 @@ func NewRepoContext() {
}
// Check Git version.
- gitVer, err := git.Version()
+ gitVer, err := git.BinVersion()
if err != nil {
log.Fatal(4, "Fail to get Git version: %v", err)
}
@@ -309,6 +309,10 @@ func (repo *Repository) RepoLink() string {
return setting.AppSubUrl + "/" + repo.MustOwner().Name + "/" + repo.Name
}
+func (repo *Repository) ComposeCompareURL(oldCommitID, newCommitID string) string {
+ return fmt.Sprintf("%s/%s/compare/%s...%s", repo.MustOwner().Name, repo.Name, oldCommitID, newCommitID)
+}
+
func (repo *Repository) FullRepoLink() string {
return setting.AppUrl + repo.MustOwner().Name + "/" + repo.Name
}