func GetDotGitPath(path string) (result string, err error) {
	dir, err := filepath.Abs(path)
	files, err := ioutil.ReadDir(dir)
	if err != nil {
		dir = filepath.Dir(path)
		return GetDotGitPath(dir)
	}

	for _, file := range files {
		if file.IsDir() && file.Name() == ".git" {
			return dir, err
		}
	}

	if dir != "/" {
		dir = filepath.Dir(dir)
		return GetDotGitPath(dir)
	}
	return result, err
}
// GetDotGitPath returns the .git path from the arg path
GetDotGitPath returns the .git path from the arg path
// GetDotGitPath returns the . git path from the arg path
func GetDotGitPath(path string) (result string, err error) {
	dir, err := filepath.Abs(path)
	files, err := ioutil.ReadDir(dir)
	if err != nil {
		dir = filepath.Dir(path)
		return GetDotGitPath(dir)
	}
	for _, file := range files {
		if file.IsDir() && file.Name() == ".git" {
			return dir, err
		}
	}
	if dir != "/" {
		dir = filepath.Dir(dir)
		return GetDotGitPath(dir)
	}
	return result, err
}
func GetDotGitPath ( path string ) ( result string , err error ) { dir , err := filepath . Abs ( path ) files , err := ioutil . ReadDir ( dir ) if err != nil { dir = filepath . Dir ( path ) return GetDotGitPath ( dir ) } for _ , file := range files { if file . IsDir ( ) && file . Name ( ) == " " { return dir , err } } if dir != " " { dir = filepath . Dir ( dir ) return GetDotGitPath ( dir ) } return result , err }
GetDotGitPath returns the .git path from the arg path
GetDotGitPath returns the . git path from the arg path