libgit2/libgit2 — pull request #2214 by ethomson (2014-03-28 01:20:39+00:00)
Title: RFC: Sandbox HOME during test execution

With the introduction of https://github.com/libgit2/libgit2/pull/2213, it occurs to me that basically all our tests fail when run in an environment where `core.safecrlf=true`, because it's a crazy setting that basically enforces that everything in the working directory have Windows-type line endings and many of our tests have Unix-type line endings.

One solution to this problem would be to always ensure that the tests use `\r\n` on Windows and `\n` on Unix, but this is a lot of overhead on developer's brain power for very little gain.

A more sane solution is to isolate developer configuration so that a developer can have `core.safecrlf` in their `.gitconfig` without actually impacting a test run. One solution to this is to simply set `HOME` to some directory beneath the clar sandbox directory so that these sorts of global settings by the developers do not interact with the tests themselves.

If we agree that this is useful, then one solution is to split `clar_test` into its three components: setup, test execution and teardown, so that we can get the clar sandbox directory before starting the test run. This is a quick illustration of what that would look like. Obviously if we want to go in this direction, these changes would go into clar itself.