fix: Prevent SIGSEGV
@@ -242,8 +242,10 @@ func (c *Client) LoadRepoOwners(org, repo, base string) (RepoOwner, error) {
gitRepo, err = c.git.SparseClone(cloneRef, sparseCheckoutPatterns)
} else {
gitRepo, err = c.git.Clone(cloneRef)
+ if gitRepo != nil {
defer gitRepo.Clean()
}
+ }
if err != nil {
return nil, fmt.Errorf("failed to clone %s: %v", cloneRef, err)
}
