git-lfs/tools
Chris Darroch c40eca710a tools/iotools.go: always close temp spool file
In commit e861b79a49b02996d22191ebb142feb8768358de of #5595 the
Windows variant of our tools.CheckCloneFileSupported() function was
updated to address the problem that it could fail to remove the
temporary files it creates to test whether the "file clone" operation
(as used by the "git lfs dedup" command) is supported in a given
directory.  This problem could occur on Windows because we did not
close all of the temporary file's open descriptors, and so our
deferred call to os.Remove() might not succeed.

In a similar vein, we also update our tools.Spool() function (which
is used in the "git lfs smudge" command to handle non-pointer data) to
ensure that if it creates a temporary file into which it spools data,
it always closes that file before trying to remove it.  While this
should have no advantage on non-Windows systems which allow for files
to be deleted while there are still open file descriptors for them,
on Windows this change should mean we never fail to clean up our
temporary spool file, if we create one.
2024-01-15 19:27:40 -08:00
..
humanize make additional message strings translatable 2022-01-29 22:36:19 -08:00
kv Replace deprecated io/ioutil functions 2024-01-11 03:48:51 +08:00
channels.go extract base channel wrapper to tools 2016-11-18 12:02:38 -07:00
copycallback_test.go progress,tools: move CopyCallback (and related) to 'tools' 2017-11-22 14:08:33 -08:00
copycallback.go fix upload retry 'file already closed' issue' 2020-02-26 11:13:54 +08:00
cygwin_windows.go tools: don't match MINGW as Cygwin 2022-09-07 18:43:20 +00:00
cygwin.go Update formatting for Go 1.17 2021-08-17 20:24:58 +02:00
filetools_nix.go Update formatting for Go 1.17 2021-08-17 20:24:58 +02:00
filetools_test.go Replace deprecated io/ioutil functions 2024-01-11 03:48:51 +08:00
filetools_windows.go Update formatting for Go 1.17 2021-08-17 20:24:58 +02:00
filetools.go Replace deprecated io/ioutil functions 2024-01-11 03:48:51 +08:00
iotools_test.go Set package version to v3 2021-09-02 20:41:08 +00:00
iotools.go tools/iotools.go: always close temp spool file 2024-01-15 19:27:40 -08:00
math_test.go commands,tools: fix ClampInt() function and tests 2021-03-10 21:11:54 -08:00
math.go commands,tools: fix ClampInt() function and tests 2021-03-10 21:11:54 -08:00
ordered_set_test.go tools: introduce tools.OrderedSet 2017-06-21 16:50:19 -06:00
ordered_set.go tools: introduce tools.OrderedSet 2017-06-21 16:50:19 -06:00
os_tools.go subprocess: report errors when finding executables 2022-04-19 09:45:20 -07:00
robustio_windows.go Drop pre-1.13 Go compatibility code 2023-05-11 15:38:53 +03:00
robustio.go Update formatting for Go 1.17 2021-08-17 20:24:58 +02:00
str_tools_test.go tools: move ShellQuote to subprocess 2018-09-14 21:50:09 +00:00
str_tools.go update inline comments to Go v1.19 doc format 2022-09-25 18:15:31 -07:00
stringset.go Fix Typos 2019-07-24 07:17:40 +00:00
sync_writer.go tools: add empty functions when missing in *SyncWriter 2017-12-01 09:39:02 -08:00
time_tools_test.go tools/time_tools: test tools.IsExpiredAtOrIn 2017-04-06 13:38:31 -06:00
time_tools.go tools: compare expiration to "time.Now" instead of "from" 2017-08-25 14:48:33 -04:00
umask_nix.go Update formatting for Go 1.17 2021-08-17 20:24:58 +02:00
umask_windows.go Update formatting for Go 1.17 2021-08-17 20:24:58 +02:00
util_darwin_test.go Replace deprecated io/ioutil functions 2024-01-11 03:48:51 +08:00
util_darwin.go tools/util_{darwin,linux}.go: close cloned files 2024-01-15 19:27:40 -08:00
util_generic.go tools: make strings translatable 2022-01-18 17:38:25 +00:00
util_linux.go tools/util_{darwin,linux}.go: close cloned files 2024-01-15 19:27:40 -08:00
util_test.go Replace deprecated io/ioutil functions 2024-01-11 03:48:51 +08:00
util_windows_test.go Replace deprecated io/ioutil functions 2024-01-11 03:48:51 +08:00
util_windows.go tools/util_windows.go: always close cloned files 2024-01-15 10:00:21 -08:00