git-lfs/tools
Chris Darroch 552614aee8 commands,tools: fix ClampInt() function and tests
The ClampInt() function does not always return a value
between its "min" and "max" arguments because it reverses
their meaning, and the relevant tests in the corresponding
tools/math_test.go file do not report the problem because
they do not execute when the "go test ./tools" command is run.
The latter bug is a result of the test functions lacking the
necessary Test* prefix to be recognized by the Go "test"
command.

After we fix the ClampInt() function, we rename all the
test functions in tools/math_test.go to follow the Test*()
naming scheme, which ensures they now run properly.

Lastly, we change the one caller of the ClampInt() function,
the migrateInfoCommand() function, which previously worked
correctly because it also reversed the order of the
arguments it passed to the function.  That reversal was
introduced in commit bd2e1b27368745f4014a448c371fd72c658ef9d6
in PR #2313, as part of the development of the "migrate info"
command, presumably because the author discovered the call
was not working as expected.
2021-03-10 21:11:54 -08:00
..
humanize Fix humanize's FormatByteRate() to work with 0s duration 2018-10-24 15:02:40 +00:00
kv tools/kv: Fix dropped test error 2019-10-25 13:25:52 -07: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: detect MINGW as Cygwin 2019-08-02 17:23:46 +00:00
cygwin.go tools: wrap os.Getwd with cygwin support 2017-02-20 15:25:43 -07:00
filetools_nix.go tools: add a function to properly canonicalize paths 2021-03-01 22:10:19 +00:00
filetools_test.go tools: unset XDG_CONFIG_HOME for filetools test 2021-03-10 13:53:02 -08:00
filetools_windows.go tools: add a function to properly canonicalize paths 2021-03-01 22:10:19 +00:00
filetools.go Use tools.CanonicalizeSystemPath to canonicalize paths 2021-03-01 22:10:19 +00:00
iotools_test.go update package imports 2016-11-15 10:01:18 -07:00
iotools.go Tidy files 2019-10-02 19:17:28 +00: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 tools: always force a UTF-8 locale for cygpath 2020-09-08 19:12:02 +00:00
robustio_windows.go tools: use ERROR_SHARING_VIOLATION const from golang.org/x/sys/windows 2020-10-26 00:04:08 +01:00
robustio.go Implement retry logic to fix LFS storage race conditions on Windows 2019-11-05 17:30:13 +03:00
str_tools_test.go tools: move ShellQuote to subprocess 2018-09-14 21:50:09 +00:00
str_tools.go tools: move ShellQuote to subprocess 2018-09-14 21:50:09 +00: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 tools: add function to make directories honoring core.sharedRepository 2018-12-13 17:51:02 +00:00
umask_windows.go tools: add function to make directories honoring core.sharedRepository 2018-12-13 17:51:02 +00:00
util_darwin_test.go Add new command git lfs dedup for file system level deduplication. 2019-08-19 10:44:37 +09:00
util_darwin.go tools: implement cloneFileSyscall on darwin without cgo 2021-01-29 09:45:34 +01:00
util_generic.go tools: implement cloneFileSyscall on darwin without cgo 2021-01-29 09:45:34 +01:00
util_linux.go tools: use IoctlFileClone from golang.org/x/sys/unix 2020-09-23 16:06:45 +02:00
util_test.go Add new command git lfs dedup for file system level deduplication. 2019-08-19 10:44:37 +09:00
util_windows_test.go Revert "Stop replacing files in LFS storage when downloading them concurrently on Windows" 2019-11-05 17:30:13 +03:00
util_windows.go Revert "Stop replacing files in LFS storage when downloading them concurrently on Windows" 2019-11-05 17:30:13 +03:00