aboutsummaryrefslogtreecommitdiffstats
path: root/repository/git.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-12-08 15:09:58 +0100
committerMichael Muré <batolettre@gmail.com>2020-12-08 15:09:58 +0100
commit8128bb79b0db9023a98c356e4e173d846057c577 (patch)
tree38bd884b8a9238603976a6c81434e2c92112bd57 /repository/git.go
parent52ef5e96f543ca242a9e1e8f2917492eb3d3fb95 (diff)
downloadgit-bug-8128bb79b0db9023a98c356e4e173d846057c577.tar.gz
repo: close before deleting
Diffstat (limited to 'repository/git.go')
-rw-r--r--repository/git.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/repository/git.go b/repository/git.go
index 993e6cc6..bc9d8772 100644
--- a/repository/git.go
+++ b/repository/git.go
@@ -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)