forked from toolshed/abra
14
pkg/git/common.go
Normal file
14
pkg/git/common.go
Normal file
@ -0,0 +1,14 @@
|
||||
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
|
||||
}
|
Reference in New Issue
Block a user