git-lfs/commands
Chris Darroch b8f8686c6b commands,t: add migrate info --top option tests
We can simplify one line in the migrateInfoCommand()
function where it resets the "entries" list of informational
entries to be output to include no more entries than the
setting of the --top option, because we have already
clamped the migrateInfoTopN value to be between zero and
the total number of entries.  So we can drop the second
call to tools.MaxInt() here; there is no chance
migrateInfoTopN could be less than zero at this point.

To confirm our changes and any future ones work as
advertised, we then add one test and revise one other.

The new test checks that the --top option works in
multiple cases, including when its value is zero or below
zero, or when it is greater than the number of available
entries to be printed by the "git lfs migrate info" command.

The revised test is changed so that it confirms that only
the highest available entry is printed when --top=1 is
specified.  Previously, because the --above option is also
set in this test, there was only one matching entry to be
printed, and so the --top=1 was redundant.  If --top=2 had
been specified, the test would still have passed.
2021-03-10 21:13:28 -08:00
..
command_checkout.go commands: make sure we're in the working tree 2020-10-14 20:58:28 +00:00
command_clean.go progress,tools: move CopyCallback (and related) to 'tools' 2017-11-22 14:08:33 -08:00
command_clone.go commands: make sure we're in the working tree 2020-10-14 20:58:28 +00:00
command_dedup.go commands: make sure we're in the working tree 2020-10-14 20:58:28 +00:00
command_env.go commands: canonicalize certain Git environment variables 2020-10-14 16:49:23 +00:00
command_ext.go update package imports 2016-11-15 10:01:18 -07:00
command_fetch.go commands: make sure we're in the working tree 2020-10-14 20:58:28 +00:00
command_filter_process.go commands: close TransferQueue when items processed 2020-02-12 19:20:45 +03:00
command_fsck.go commands: make sure we're in the working tree 2020-10-14 20:58:28 +00:00
command_install.go commands: make sure we're in the working tree 2020-10-14 20:58:28 +00:00
command_lock.go Use tools.CanonicalizeSystemPath to canonicalize paths 2021-03-01 22:10:19 +00:00
command_locks.go locking: "locks --verify" supports "--cached" 2019-03-28 10:12:41 +01:00
command_logs.go remove reliance on global config filesystem vars 2017-10-18 18:09:33 -06:00
command_ls_files.go commands: make sure we're in the working tree 2020-10-14 20:58:28 +00:00
command_migrate_export.go commands: make sure we're in the working tree 2020-10-14 20:58:28 +00:00
command_migrate_import.go migrate import: ensure all files end up in .gitattributes 2020-11-23 22:11:09 +00:00
command_migrate_info.go commands,t: add migrate info --top option tests 2021-03-10 21:13:28 -08:00
command_migrate.go Add --above parameter to 'migrate import'. 2020-11-05 18:57:25 -08:00
command_pointer.go Fix error strings to follow Go guidelines 2019-10-22 17:33:49 +03:00
command_post_checkout.go Update usage info for post-checkout 2018-01-19 21:28:09 -05:00
command_post_commit.go commands: remove any cfg.Remote() calls from Command flags 2017-10-27 15:07:36 -06:00
command_post_merge.go commands: remove any cfg.Remote() calls from Command flags 2017-10-27 15:07:36 -06:00
command_pre_push.go Add GIT_LFS_SKIP_PUSH to allow skipping the pre-push hook 2020-09-29 09:46:49 +02:00
command_prune.go prune: add options to be more aggressive about pruning 2021-01-13 19:30:40 +00:00
command_pull.go commands: make sure we're in the working tree 2020-10-14 20:58:28 +00:00
command_push.go commands: change default branch name 2021-02-01 21:37:32 +00:00
command_smudge.go Check error when creating local storage directory 2020-02-10 16:07:59 +00:00
command_standalone_file.go Provide support for file URLs via a transfer agent 2019-08-02 17:23:47 +00:00
command_status.go commands: make sure we're in the working tree 2020-10-14 20:58:28 +00:00
command_track.go commands: make sure we're in the working tree 2020-10-14 20:58:28 +00:00
command_uninstall.go add per-worktree configuration option 2020-06-26 14:56:04 -07:00
command_unlock.go commands/unlock: always attempt an unlock with --force 2019-03-14 14:26:21 +00:00
command_untrack.go commands: make sure we're in the working tree 2020-10-14 20:58:28 +00:00
command_update.go commands: make sure we're in the working tree 2020-10-14 20:58:28 +00:00
command_version.go lfsapi: extract new lfshttp package 2018-09-11 14:51:29 -07:00
commands_test.go commands: don't honor lfs.fetch* for ls-files 2020-03-31 13:55:24 +00:00
commands.go Use tools.CanonicalizeSystemPath to canonicalize paths 2021-03-01 22:10:19 +00:00
lockverifier.go locking: "locks --verify" supports "--cached" 2019-03-28 10:12:41 +01:00
multiwriter.go tasklog: check for connected tty on the actual writer 2018-11-14 14:35:29 -08:00
path_nix.go commands: osLineEnding() is more descriptive 2017-02-03 17:50:47 -07:00
path_windows.go commands: osLineEnding() is more descriptive 2017-02-03 17:50:47 -07:00
path.go track: use default line endings for core.autocrlf=input 2019-07-16 16:57:21 +00:00
pointers.go each command should open and close a gitscanner just once 2016-11-17 17:22:21 -07:00
pull.go pull: gracefully handle merge conflicts 2020-10-22 20:56:31 +00:00
run.go commands: canonicalize certain Git environment variables 2020-10-14 16:49:23 +00:00
uploader_test.go commands: extract lockVerifier from uploadContext 2017-11-01 17:35:43 -06:00
uploader.go Check error when creating local storage directory 2020-02-10 16:07:59 +00:00