repo: close before deleting

This commit is contained in:
Michael Muré 2020-12-08 15:09:58 +01:00
parent 52ef5e96f5
commit 8128bb79b0
No known key found for this signature in database
GPG Key ID: A4457C029293126F
2 changed files with 10 additions and 0 deletions

View File

@ -488,6 +488,11 @@ func (repo *GitRepo) GetLocalRemote() string {
// EraseFromDisk delete this repository entirely from the disk
func (repo *GitRepo) EraseFromDisk() error {
err := repo.Close()
if err != nil {
return err
}
path := filepath.Clean(strings.TrimSuffix(repo.path, string(filepath.Separator)+".git"))
// fmt.Println("Cleaning repo:", path)

View File

@ -734,6 +734,11 @@ func (repo *GoGitRepo) GetLocalRemote() string {
// EraseFromDisk delete this repository entirely from the disk
func (repo *GoGitRepo) EraseFromDisk() error {
err := repo.Close()
if err != nil {
return err
}
path := filepath.Clean(strings.TrimSuffix(repo.path, string(filepath.Separator)+".git"))
// fmt.Println("Cleaning repo:", path)