There are several places in our testsuite where the git-lfs binary we're
testing produces canonical paths. Ensure that our test framework also
uses canonical paths so that our comparisons for equality do not fail
spuriously.
We set some variables for the test harness when running in CI on
Windows. However, if these variables leak into the environment of the
Git LFS process, they'll cause the test to fail, since they'll be
printed in the env output. Make sure that we unset them in the tests
that care about this to ensure that they don't cause failures.
One commonly requested feature for Git LFS is support for local files.
Currently, we tell users that they must use a standalone transfer
agent, which is true, but nobody has provided one yet. Since writing a
simple transfer agent is not very difficult, let's provide one
ourselves.
Introduce a basic standalone transfer agent, git lfs standalone-file,
that handles uploads and downloads. Add a default configuration required
for it to work, while still allowing users to override this
configuration if they have a preferred implementation that is more
featureful. We provide this as a transfer agent instead of built-in
because it avoids the complexity of adding a different code path to the
main codebase, but also serves as a demonstration of how to write a
standalone transfer agent for others who might want to do so, much
like Git demonstrates remote helpers using its HTTP helper.
When using worktrees, the hooks are stored once, in the main repository,
not in a per-worktree location. Install the hooks in the proper place
instead of creating and populating a hooks directory that will never be
used.
Previously, the contains_same_elements() function was causing
tests to immediately exit when called, meaning that portions of
many tests were being inadvertently skipped. This fixes the
contains_same_elements() function so it no longer exits the test,
and fixes the failing tests exposed by this change.