Skip to content
Snippets Groups Projects
Commit 9a6491edea3e authored by Dan Villiom Podlaski Christiansen's avatar Dan Villiom Podlaski Christiansen
Browse files

fetch: extract common tempfile arguments

parent 4aa0e09581a9
No related branches found
No related tags found
1 merge request!127Remove some unnecessary caching
......@@ -1268,4 +1268,8 @@
return [x for x in filteredrefs.values() if x not in self.git]
progress = GitProgress(self.ui)
tempargs = dict(
prefix=b'hg-git-fetch-', suffix=b'.pack', dir=self.gitdir,
)
max_size = self.ui.configint(b'hggit', b'fetchbuffer') * 1e6
......@@ -1271,10 +1275,5 @@
max_size = self.ui.configint(b'hggit', b'fetchbuffer') * 1e6
f = tempfile.SpooledTemporaryFile(
prefix=b'hg-git-fetch-',
suffix=b'.pack',
dir=self.gitdir,
max_size=max_size,
)
f = tempfile.SpooledTemporaryFile(**tempargs, max_size=max_size)
try:
ret = self._call_client(remote_name, 'fetch_pack', determine_wants,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment