summaryrefslogtreecommitdiffstats
path: root/models/repo.go
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/repo.go
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/repo.go')
-rw-r--r--models/repo.go6
1 files changed, 6 insertions, 0 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 {