t4014: support Git version strings with spaces

git --version reports its version with the prefix "git version ". Remove precisely this string instead of everything up to and including the rightmost space to avoid butchering version strings that contain spaces. This helps Apple's release of Git, which reports its version like this: "git version 2.50.1 (Apple Git-155)". Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

René Scharfe committed Dec 13, 2025 at 10:40 UTC 007b8994d4fc49f4a68ee414db9e814736a3fc04
1 file changed +1 -1
t/t4014-format-patch.sh
+1 -1
@@ -980,7 +980,7 @@ test_expect_success 'format-patch --ignore-if-in-upstream HEAD' '
980
981 test_expect_success 'get git version' '
982 git_version=$(git --version) &&
983 - git_version=${git_version##* }
983 + git_version=${git_version#git version }
984 '
985
986 signature() {