diff options
Diffstat (limited to 'git/repo/base.py')
| -rw-r--r-- | git/repo/base.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/git/repo/base.py b/git/repo/base.py index f7a01d09..990def64 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -209,9 +209,17 @@ class Repo(object): def close(self): if self.git: self.git.clear_cache() - gc.collect() + # Tempfiles objects on Windows are holding references to + # open files until they are collected by the garbage + # collector, thus preventing deletion. + # TODO: Find these references and ensure they are closed + # and deleted synchronously rather than forcing a gc + # collection. + if is_win: + gc.collect() gitdb.util.mman.collect() - gc.collect() + if is_win: + gc.collect() def __eq__(self, rhs): if isinstance(rhs, Repo): @@ -905,6 +913,10 @@ class Repo(object): odbt = kwargs.pop('odbt', odb_default_type) + # when pathlib.Path or other classbased path is passed + if not isinstance(path, str): + path = str(path) + ## A bug win cygwin's Git, when `--bare` or `--separate-git-dir` # it prepends the cwd or(?) the `url` into the `path, so:: # git clone --bare /cygwin/d/foo.git C:\\Work |
