diff options
author | Unknwon <u@gogs.io> | 2015-09-06 18:19:30 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-09-06 18:19:30 -0400 |
commit | 0806725ca51770abf12fa3b5e99542826c123c77 (patch) | |
tree | cbb4df8e0542325fb330eaf934b9a080e18a1f64 /models/repo.go | |
parent | d504ee04170551f9140526379963a35fb73298aa (diff) | |
download | gitea-0806725ca51770abf12fa3b5e99542826c123c77.tar.gz gitea-0806725ca51770abf12fa3b5e99542826c123c77.zip |
minor fix on #1589
Signed-off-by: Unknwon <u@gogs.io>
Diffstat (limited to 'models/repo.go')
-rw-r--r-- | models/repo.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/models/repo.go b/models/repo.go index 06c97baf24..62a8b9740d 100644 --- a/models/repo.go +++ b/models/repo.go @@ -472,8 +472,12 @@ func MigrateRepository(u *User, name, desc string, private, mirror bool, url str // Check if repository is empty. _, stderr, err = com.ExecCmdDir(repoPath, "git", "log", "-1") - if err != nil && strings.Contains(stderr, "fatal: bad default revision 'HEAD'") { - repo.IsBare = true + if err != nil { + if strings.Contains(stderr, "fatal: bad default revision 'HEAD'") { + repo.IsBare = true + } else { + return repo, fmt.Errorf("check bare: %v - %s", err, stderr) + } } // Check if repository has master branch, if so set it to default branch. |