diff options
Diffstat (limited to 'models')
-rw-r--r-- | models/git.go | 8 | ||||
-rw-r--r-- | models/repo.go | 1 |
2 files changed, 5 insertions, 4 deletions
diff --git a/models/git.go b/models/git.go index 77b7ef2d..68e13905 100644 --- a/models/git.go +++ b/models/git.go @@ -14,6 +14,8 @@ import ( "path" "strings" + "github.com/Unknwon/com" + "github.com/gogits/git" "github.com/gogits/gogs/modules/base" @@ -163,13 +165,11 @@ func getReposFiles(userName, repoName, commitId string, rpath string) ([]*RepoFi return 0 } - cmd := exec.Command("git", "log", "-1", "--pretty=format:%H", commitId, "--", path.Join(dirname, entry.Name)) - cmd.Dir = repopath - out, err := cmd.Output() + stdout, _, err := com.ExecCmdDir(repopath, "git", "log", "-1", "--pretty=format:%H", commitId, "--", path.Join(dirname, entry.Name)) if err != nil { return 0 } - filecm, err := repo.GetCommit(string(out)) + filecm, err := repo.GetCommit(string(stdout)) if err != nil { return 0 } diff --git a/models/repo.go b/models/repo.go index 573e0f4e..91dc7102 100644 --- a/models/repo.go +++ b/models/repo.go @@ -80,6 +80,7 @@ type Repository struct { IsPrivate bool IsBare bool IsGoget bool + DefaultBranch string Created time.Time `xorm:"created"` Updated time.Time `xorm:"updated"` } |