sync: Non-empty directory without .git is Fatal
This commit is contained in:
parent
3c0751a78a
commit
9d639a0315
1 changed files with 2 additions and 0 deletions
|
@ -66,6 +66,8 @@ func (i GitImporter) Init() error {
|
||||||
return fmt.Errorf("%w:\n%s", err, stdout)
|
return fmt.Errorf("%w:\n%s", err, stdout)
|
||||||
}
|
}
|
||||||
log.Println("Local git repository successfully cloned")
|
log.Println("Local git repository successfully cloned")
|
||||||
|
} else if _, err := os.Stat(path.Join(i.li.Base, ".git")); errors.Is(err, os.ErrNotExist) {
|
||||||
|
log.Fatal(i.li.Base, "is not a valid git repository and it cannot be initialized because it's not empty.")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the .git directory exists, change the origin remote to our
|
// Check if the .git directory exists, change the origin remote to our
|
||||||
|
|
Reference in a new issue