summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pkg/commands/git.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/pkg/commands/git.go b/pkg/commands/git.go
index 265d6553e..64f3cd4b1 100644
--- a/pkg/commands/git.go
+++ b/pkg/commands/git.go
@@ -27,8 +27,11 @@ func navigateToRepoRootDirectory(stat func(string) (os.FileInfo, error), chdir f
for {
f, err := stat(".git")
- if err == nil && f.IsDir() {
- return nil
+ if err == nil {
+ if f.IsDir() {
+ return nil
+ }
+ return errors.New("expected .git to be a directory")
}
if !os.IsNotExist(err) {