Commit de5abb5
git-p4: auto-delete named temporary file
Avoid double-open exceptions on Windows platform when
calculating for lfs compressed size threshold
(git-p4.largeFileCompressedThreshold) comparisons.
Take new approach using the NamedTemporaryFile()
file-like object as input to the ZipFile() which
auto-deletes after implicit close leaving with scope.
Original code had double-open exception on Windows
platform because file still open from NamedTemporaryFile()
using generated filename instead of object.
Thanks to Andrey for patiently suggesting several
iterations on this change for avoiding exceptions!
Also print error details after resulting IOError to make
debugging cause of exception less mysterious when it has
nothing to do with "git version recent enough."
Signed-off-by: Philip.McGraw <[email protected]>
Reviewed-by: Andrey Mazo <[email protected]>
Acked-by: Luke Diamand <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>1 parent c90b652 commit de5abb5
1 file changed
+6
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1160 | 1160 | | |
1161 | 1161 | | |
1162 | 1162 | | |
1163 | | - | |
1164 | | - | |
1165 | | - | |
1166 | | - | |
1167 | | - | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
1168 | 1167 | | |
1169 | | - | |
1170 | 1168 | | |
1171 | 1169 | | |
1172 | 1170 | | |
| |||
3525 | 3523 | | |
3526 | 3524 | | |
3527 | 3525 | | |
3528 | | - | |
| 3526 | + | |
3529 | 3527 | | |
| 3528 | + | |
3530 | 3529 | | |
3531 | 3530 | | |
3532 | 3531 | | |
| |||
0 commit comments