mirror of
https://github.com/go-gitea/gitea
synced 2025-07-05 10:07:22 +00:00
Move duplicated functions (#33977)
Remove duplicated functions `IsExist`, `IsFile` and `IsDir` in package `modules/git` and use the exists functions in `modules/util`.
This commit is contained in:
@ -49,7 +49,12 @@ func OpenRepository(ctx context.Context, repoPath string) (*Repository, error) {
|
||||
repoPath, err := filepath.Abs(repoPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else if !isDir(repoPath) {
|
||||
}
|
||||
exist, err := util.IsDir(repoPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exist {
|
||||
return nil, util.NewNotExistErrorf("no such file or directory")
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user