mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 06:44:59 +00:00
cleanup inside GitTemporaryDirectory
This commit is contained in:
parent
6b3342a150
commit
997d7a995d
1 changed files with 5 additions and 1 deletions
|
@ -38,9 +38,13 @@ class ChdirTemporaryDirectory(IgnorantTemporaryDirectory):
|
||||||
class GitTemporaryDirectory(ChdirTemporaryDirectory):
|
class GitTemporaryDirectory(ChdirTemporaryDirectory):
|
||||||
def __enter__(self):
|
def __enter__(self):
|
||||||
res = super().__enter__()
|
res = super().__enter__()
|
||||||
make_repo()
|
self.repo = make_repo()
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
def __exit__(self, exc_type, exc_val, exc_tb):
|
||||||
|
del self.repo
|
||||||
|
super().__exit__(exc_type, exc_val, exc_tb)
|
||||||
|
|
||||||
|
|
||||||
def make_repo(path=None):
|
def make_repo(path=None):
|
||||||
if not path:
|
if not path:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue