func()

in filemanager/gitwrapper.go [25:44]


func (fm *FileManager) isGitRepository() *Error {
	fi, err := os.Stat(fm.Path)
	if os.IsNotExist(err) {
		return &Error{code: http.StatusNotFound, err: fmt.Errorf("the path does not exist")}
	}

	if err != nil {
		return &Error{code: http.StatusUnprocessableEntity, err: err}
	}

	if !fi.Mode().IsDir() {
		return &Error{code: http.StatusUnprocessableEntity, err: fmt.Errorf("the path must be a directory")}
	}

	if err := fm.runGitRepositoryCheck(); err != nil {
		return err
	}

	return nil
}