diff options
author | Unknwon <u@gogs.io> | 2015-11-20 02:38:41 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-11-20 02:38:41 -0500 |
commit | 987dcc5372998adaafb68e00a9a460e955d018e5 (patch) | |
tree | 6f88db3bee30cab2339244c124e6c82324a597a1 /modules/git | |
parent | 9b6c835715ab27aa7a008a51415f38ca2a856cd0 (diff) | |
download | gitea-987dcc5372998adaafb68e00a9a460e955d018e5.tar.gz gitea-987dcc5372998adaafb68e00a9a460e955d018e5.zip |
fix #1383
Diffstat (limited to 'modules/git')
-rw-r--r-- | modules/git/repo.go | 3 |
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 |