summaryrefslogtreecommitdiffstats
path: root/modules/git
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-11-20 02:38:41 -0500
committerUnknwon <u@gogs.io>2015-11-20 02:38:41 -0500
commit987dcc5372998adaafb68e00a9a460e955d018e5 (patch)
tree6f88db3bee30cab2339244c124e6c82324a597a1 /modules/git
parent9b6c835715ab27aa7a008a51415f38ca2a856cd0 (diff)
downloadgitea-987dcc5372998adaafb68e00a9a460e955d018e5.tar.gz
gitea-987dcc5372998adaafb68e00a9a460e955d018e5.zip
fix #1383
Diffstat (limited to 'modules/git')
-rw-r--r--modules/git/repo.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/git/repo.go b/modules/git/repo.go
index 14ac39a3ed..39fad97d37 100644
--- a/modules/git/repo.go
+++ b/modules/git/repo.go
@@ -5,6 +5,7 @@
package git
import (
+ "errors"
"path/filepath"
)
@@ -21,6 +22,8 @@ func OpenRepository(repoPath string) (*Repository, error) {
repoPath, err := filepath.Abs(repoPath)
if err != nil {
return nil, err
+ } else if !isDir(repoPath) {
+ return nil, errors.New("no such file or directory")
}
return &Repository{Path: repoPath}, nil