There are two ways to specify an alternate in Git: via the repository
file or via the environment. gitobj recently learned how to accept the
contents of an environment variable and use it, so pass the environment
variable when creating a new object database.
When performing a fetch, we don't use the object scanner, but we do when
performing a push. To make sure that we're exercising the object scanner
and gitobj adequately, simulate a push using alternates as well.
This test works fine on Unix systems, but fails on Windows. This occurs
because the MSYS environment uses Unix-style paths, but Git wants
Windows-style paths in its environment and alternates files. Convert the
paths to an appropriate format to ensure this test passes on Windows as
well.
The test for alternates was named test-alternates.sh, but only tests
matching "t-*.sh" are run automatically. Since we want to make sure that
alternates continue to work, rename this file. Update the source command
to use the correct directory as well.