]> Kevux Git Server - rit/commitdiff
t/interop: report which vanilla git command failed
authorJeff King <peff@peff.net>
Thu, 12 Jan 2023 16:39:36 +0000 (11:39 -0500)
committerJunio C Hamano <gitster@pobox.com>
Fri, 13 Jan 2023 19:48:24 +0000 (11:48 -0800)
The interop test library sets up wrappers "git.a" and "git.b" to
represent the two versions to be tested. It also wraps vanilla "git" to
report an error, with the goal of catching tests which accidentally fail
to use one of the version-specific wrappers (which could invalidate the
tests in a very subtle way).

But when it catches an invocation of vanilla git, it doesn't give any
details, which makes it very hard to debug exactly which invocation is
responsible (especially if it's buried in a function invocation, etc).
Let's report the arguments passed to git, which helps narrow it down.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/interop/interop-lib.sh

index 3e0a291..62f4481 100644 (file)
@@ -68,7 +68,7 @@ generate_wrappers () {
        wrap_git .bin/git.a "$DIR_A" &&
        wrap_git .bin/git.b "$DIR_B" &&
        write_script .bin/git <<-\EOF &&
-       echo >&2 fatal: test tried to run generic git
+       echo >&2 fatal: test tried to run generic git: $*
        exit 1
        EOF
        PATH=$(pwd)/.bin:$PATH