]> git.ipfire.org Git - thirdparty/git.git/commit
test-lib: make $GIT_BUILD_DIR an absolute path
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Sun, 27 Feb 2022 10:25:12 +0000 (11:25 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 28 Feb 2022 21:35:56 +0000 (13:35 -0800)
commitb9638d7286fbfef46e325049cdd8cfa3fff3edc1
treec5cf1d1ad4a84a6cce8aa7da0bfb2935a0f360d6
parent9dbf20e7f62456400d0011ed8a238ae1f9872665
test-lib: make $GIT_BUILD_DIR an absolute path

Change the GIT_BUILD_DIR from a path like "/path/to/build/t/.." to
"/path/to/build". The "TEST_DIRECTORY" here is already made an
absolute path a few lines above this.

We could simply do $(cd "$TEST_DIRECTORY"/.." && pwd) here, but as
noted in the preceding commit the "$TEST_DIRECTORY" can't be anything
except the path containing this test-lib.sh file at this point, so we
can more cheaply and equally strip the "/t" off the end.

This change will be helpful to LSAN_OPTIONS which will want to strip
the build directory path from filenames, which we couldn't do if we
had a "/.." in there.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/test-lib.sh