command/env: ensure we honor lfs.url #3470
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When we attempt to look up an endpoint to push to or pull from a remote, we call the endpoint finder's Endpoint method, which honors lfs.url, not the RemoteEndpoint method, which does not. However, when enumerating remotes in git lfs env, we call RemoteEndpoint, which means we produce the wrong endpoint if the lfs.url option is set.
Update the code to call the correct method, so that we get the correct results. Since the tests check for this case and print the old information (which doesn't match what we actually do), update them as well. Now that we have several tests that produce similar output because they all use lfs.url, update one of the tests to test more useful cases by removing the use of lfs.url.
Fixes #3469.