summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-07-26 18:37:18 -0400
committerUnknwon <joe2010xtmf@163.com>2014-07-26 18:37:18 -0400
commit5e8138341357f367868a32b631495c9d5a286477 (patch)
treefb36040422534e051ac381cde594ff1a208e4195 /models
parent02a81ddb6252d1a08900d548ddb63e41bcb0b8ef (diff)
downloadgitea-5e8138341357f367868a32b631495c9d5a286477.tar.gz
gitea-5e8138341357f367868a32b631495c9d5a286477.zip
Git installation check, show image in single file view, show short SHA1 instead of 40-length string, complete log module
Diffstat (limited to 'models')
-rw-r--r--models/repo.go6
-rw-r--r--models/user.go2
2 files changed, 7 insertions, 1 deletions
diff --git a/models/repo.go b/models/repo.go
index da0813e3b4..1e899c182b 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -11,6 +11,7 @@ import (
"html/template"
"io/ioutil"
"os"
+ "os/exec"
"path"
"path/filepath"
"regexp"
@@ -84,6 +85,11 @@ func LoadRepoConfig() {
func NewRepoContext() {
zip.Verbose = false
+ // Check Git installation.
+ if _, err := exec.LookPath("git"); err != nil {
+ log.Fatal(4, "Fail to test 'git' command: %v (forgotten install?)", err)
+ }
+
// Check Git version.
ver, err := git.GetVersion()
if err != nil {
diff --git a/models/user.go b/models/user.go
index 540f4b6af4..ca772556b7 100644
--- a/models/user.go
+++ b/models/user.go
@@ -81,7 +81,7 @@ type User struct {
// DashboardLink returns the user dashboard page link.
func (u *User) DashboardLink() string {
if u.IsOrganization() {
- return "/org/" + u.Name + "/dashboard"
+ return "/org/" + u.Name + "/dashboard/"
}
return "/"
}