15 lines
266 B
Go
15 lines
266 B
Go
|
package git
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"os"
|
||
|
)
|
||
|
|
||
|
// EnsureGitRepo ensures a git repo .git folder exists
|
||
|
func EnsureGitRepo(repoPath string) error {
|
||
|
if _, err := os.Stat(repoPath); os.IsNotExist(err) {
|
||
|
return fmt.Errorf("no .git directory in %s?", repoPath)
|
||
|
}
|
||
|
return nil
|
||
|
}
|