We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4a8a1fa commit 31b2ccdCopy full SHA for 31b2ccd
src/scmrepo/git/backend/dulwich/__init__.py
@@ -3,6 +3,7 @@
3
import logging
4
import os
5
import stat
6
+from contextlib import closing
7
from functools import partial
8
from io import BytesIO, StringIO
9
from typing import (
@@ -198,7 +199,9 @@ def clone(
198
199
repo = clone_from(depth=depth, branch=os.fsencode(shallow_branch))
200
else:
201
repo = clone_from()
- cls._set_default_tracking_branch(repo)
202
+
203
+ with closing(repo):
204
+ cls._set_default_tracking_branch(repo)
205
except Exception as exc:
206
raise CloneError(url, to_path) from exc
207
0 commit comments