Where needed[*1*], we arrange for the environment of a Git invocation to
contain the variable
PRINT_SHA1_ELLIPSIS="yes"
This furnishes ellipses in the output which then matches what is
expected.
[Footnote]
*1* We are being overly generous in t4013-diff-various.sh because we do
not want to destroy/take apart the here-document. Given that all this a
temporary measure, we should get away with it.
Signed-off-by: Ann T Ropea <redacted>
---
v2: rename patch series & focus on removal of ellipses
v3: env var instead of config option, use one-line comments where appropriate, preserve indent level
t/t3040-subprojects-basic.sh | 2 +-
t/t4013-diff-various.sh | 6 +++++-
t/t9300-fast-import.sh | 2 +-
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/t/t3040-subprojects-basic.sh b/t/t3040-subprojects-basic.sh
index 0a4ff6d824a0..dfd46a5672da 100755
--- a/t/t3040-subprojects-basic.sh
+++ b/t/t3040-subprojects-basic.sh
@@ -19,7 +19,7 @@ test_expect_success 'setup: create subprojects' '
git update-index --add sub1 &&
git add sub2 &&
git commit -q -m "subprojects added" &&
- git diff-tree --abbrev=5 HEAD^ HEAD |cut -d" " -f-3,5- >current &&
+ PRINT_SHA1_ELLIPSIS="yes" git diff-tree --abbrev=5 HEAD^ HEAD |cut -d" " -f-3,5- >current &&
git branch save HEAD &&
cat >expected <<-\EOF &&
:000000 160000 00000... A sub1
diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh
index c515e3e53fee..79f213dddd92 100755
--- a/t/t4013-diff-various.sh
+++ b/t/t4013-diff-various.sh
@@ -131,7 +131,11 @@ do
test_expect_success "git $cmd" '
{
echo "\$ git $cmd"
- git $cmd |
+ # All invocations receive the env var.
+ # We would destroy the here-doc if we
+ # tried to apply it to only the ones
+ # truly needing it.
+ PRINT_SHA1_ELLIPSIS="yes" git $cmd |
sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
-e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
echo "\$"diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index d47560b6343d..d93ddd91093e 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -876,7 +876,7 @@ test_expect_success 'L: verify internal tree sorting' '
EXPECT_END
git fast-import <input &&
- git diff-tree --abbrev --raw L^ L >output &&
+ PRINT_SHA1_ELLIPSIS="yes" git diff-tree --abbrev --raw L^ L >output &&
test_cmp expect output
'
--
2.13.6