func()

in filemanager/filemanager.go [98:106]


func (fm *FileManager) currentPath(path string) (string, *Error) {
	actualPath := filepath.Join(fm.Path, path)
	_, err := filepath.Rel(fm.Path, actualPath)
	if err != nil || !strings.HasPrefix(actualPath, fm.Path) {
		return "", &Error{code: http.StatusUnprocessableEntity, err: fmt.Errorf("the path %s is outside the git repository", path)}
	}

	return actualPath, nil
}