mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-02-15 14:03:06 +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,9 +27,12 @@ func navigateToRepoRootDirectory(stat func(string) (os.FileInfo, error), chdir f
|
|||||||
for {
|
for {
|
||||||
f, err := stat(".git")
|
f, err := stat(".git")
|
||||||
|
|
||||||
if err == nil && f.IsDir() {
|
if err == nil {
|
||||||
|
if f.IsDir() {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
return errors.New("expected .git to be a directory")
|
||||||
|
}
|
||||||
|
|
||||||
if !os.IsNotExist(err) {
|
if !os.IsNotExist(err) {
|
||||||
return WrapError(err)
|
return WrapError(err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user