mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-02-09 13:47:11 +02:00
Improve directory check for .git
Return error if the .git exists but is not a directory. This provides a slightly better failure message for git repo with submodules in case the '.git' is a file which provides the reference to the parent's .git folder with the submodule inside.
This commit is contained in:
parent
b505c295d2
commit
e09aac6450
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user