From ac50405044073df5caca22f8ac9d7a248b11515b Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Fri, 2 Aug 2024 11:31:51 -0700 Subject: [PATCH] t9390: skip the version test if we are in some kind of installation The version test assumes we are in a clone of the git-filter-repo repository, without the kind of changes that would be performed by an installation of git-filter-repo (which may, for example, change the shebang line or the @@LOCALEDIR@@ references). So, if we are testing an installation of git-filter-repo, simply skip this test. Signed-off-by: Elijah Newren --- t/t9390-filter-repo.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/t/t9390-filter-repo.sh b/t/t9390-filter-repo.sh index 88b02e9e..d3f907a2 100755 --- a/t/t9390-filter-repo.sh +++ b/t/t9390-filter-repo.sh @@ -1899,7 +1899,17 @@ test_expect_success 'tweaking just a tag' ' ) ' -test_expect_success '--version' ' +test_lazy_prereq IN_FILTER_REPO_CLONE ' + git -C ../../ rev-parse HEAD:git-filter-repo && + grep @@LOCALEDIR@@ ../../../git-filter-repo && + head -n 1 ../../../git-filter-repo | grep "/usr/bin/env python3$" +' + +# Next test depends on git-filter-repo coming from the git-filter-repo +# not having been modified by e.g. normal installation. Skip the test +# if we're in some kind of installation of filter-repo rather than in a +# simple clone of the original repository. +test_expect_success IN_FILTER_REPO_CLONE '--version' ' git filter-repo --version >actual && git hash-object ../../git-filter-repo | cut -c 1-12 >expect && test_cmp expect actual