From: Phillip Wood Date: Tue, 27 Oct 2026 10:57:55 GMT Subject: [PATCH 1/3] test_ref_missing(): improve error message Message-ID: In-Reply-To: From: Phillip Wood If the ref being checked exists, then test_ref_missing() does not print the name of the ref in the error message. So, if there is more than one call to test_ref_missing() in a test, it is hard to understand which one failed by looking at the test output. Fix that by printing the name of the ref that erroneously exists. Signed-off-by: Phillip Wood --- t/test-lib-functions.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh index 09a41d51adc..b56b4f0a6c8 100644 --- a/t/test-lib-functions.sh +++ b/t/test-lib-functions.sh @@ -292,18 +292,20 @@ test_ref_exists () { # a reference. This is preferable to `! test_ref_exists` as this function is # able to distinguish actually-missing references from other, generic errors. test_ref_missing () { + local refname + eval refname="\$$#" test_ref_exists "$@" case "$?" in 2) # This is the good case. return 0 ;; 0) - echo >&4 "test_ref_missing: reference exists" + echo >&4 "test_ref_missing: '$refname' exists" return 1 ;; *) - echo >&4 "test_ref_missing: generic error" + echo >&4 "test_ref_missing: generic error while checking '$refname'" return 1 ;; esac -- 2.56.0.336.g97505d19352