diff mbox series

[09/12] test libs: rename "diff-lib" to "lib-diff"

Message ID 20210209214159.22815-10-avarab@gmail.com (mailing list archive)
State New, archived
Headers show
Series test-lib: misc improvements | expand

Commit Message

Ævar Arnfjörð Bjarmason Feb. 9, 2021, 9:41 p.m. UTC
Rename the "diff-lib" to "lib-diff". With this rename and preceding
commits there is no remaining t/*lib* which doesn't follow the
convention of being called t/lib-*.
---
 t/.gitattributes                      | 2 +-
 t/{diff-lib.sh => lib-diff.sh}        | 0
 t/{diff-lib => lib-diff}/COPYING      | 0
 t/{diff-lib => lib-diff}/README       | 0
 t/t4000-diff-format.sh                | 2 +-
 t/t4001-diff-rename.sh                | 2 +-
 t/t4003-diff-rename-1.sh              | 6 +++---
 t/t4004-diff-rename-symlink.sh        | 2 +-
 t/t4005-diff-rename-2.sh              | 6 +++---
 t/t4007-rename-3.sh                   | 6 +++---
 t/t4008-diff-break-rewrite.sh         | 6 +++---
 t/t4009-diff-rename-4.sh              | 6 +++---
 t/t4010-diff-pathspec.sh              | 2 +-
 t/t4011-diff-symlink.sh               | 2 +-
 t/t4013-diff-various.sh               | 2 +-
 t/t4015-diff-whitespace.sh            | 2 +-
 t/t4027-diff-submodule.sh             | 2 +-
 t/t4034-diff-words.sh                 | 2 +-
 t/t4038-diff-combined.sh              | 2 +-
 t/t4061-diff-indent.sh                | 2 +-
 t/t4206-log-follow-harder-copies.sh   | 2 +-
 t/t7501-commit-basic-functionality.sh | 2 +-
 t/t9300-fast-import.sh                | 2 +-
 23 files changed, 30 insertions(+), 30 deletions(-)
 rename t/{diff-lib.sh => lib-diff.sh} (100%)
 rename t/{diff-lib => lib-diff}/COPYING (100%)
 rename t/{diff-lib => lib-diff}/README (100%)

Comments

Junio C Hamano Feb. 10, 2021, 9:56 p.m. UTC | #1
Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:

> Rename the "diff-lib" to "lib-diff". With this rename and preceding
> commits there is no remaining t/*lib* which doesn't follow the
> convention of being called t/lib-*.
> ---

Seeing nothing (other than the OID length abstraction that prepares
us for SHA-256 world) has happened since 2009, I have no issue with
this change and no in-flight topics would, either.

Needs a sign-off, though.
Johannes Schindelin Feb. 11, 2021, 10:13 p.m. UTC | #2
Hi Ævar,

On Tue, 9 Feb 2021, Ævar Arnfjörð Bjarmason wrote:

> diff --git a/t/.gitattributes b/t/.gitattributes
> index d778bfad052..dafa17c3e61 100644
> --- a/t/.gitattributes
> +++ b/t/.gitattributes
> @@ -1,6 +1,6 @@
>  t[0-9][0-9][0-9][0-9]/* -whitespace
>  /chainlint/*.expect eol=lf
> -/diff-lib/* eol=lf
> +/lib-diff/* eol=lf
>  /t0110/url-* binary
>  /t3206/* eol=lf
>  /t3900/*.txt eol=lf

Lucky coincidence that this is still sorted ;-)

The patch looks good to me. Thanks!
Dscho

> diff --git a/t/diff-lib.sh b/t/lib-diff.sh
> similarity index 100%
> rename from t/diff-lib.sh
> rename to t/lib-diff.sh
> diff --git a/t/diff-lib/COPYING b/t/lib-diff/COPYING
> similarity index 100%
> rename from t/diff-lib/COPYING
> rename to t/lib-diff/COPYING
> diff --git a/t/diff-lib/README b/t/lib-diff/README
> similarity index 100%
> rename from t/diff-lib/README
> rename to t/lib-diff/README
> diff --git a/t/t4000-diff-format.sh b/t/t4000-diff-format.sh
> index e5116a76a1c..cce334981e1 100755
> --- a/t/t4000-diff-format.sh
> +++ b/t/t4000-diff-format.sh
> @@ -7,7 +7,7 @@ test_description='Test built-in diff output engine.
>
>  '
>  . ./test-lib.sh
> -. "$TEST_DIRECTORY"/diff-lib.sh
> +. "$TEST_DIRECTORY"/lib-diff.sh
>
>  echo >path0 'Line 1
>  Line 2
> diff --git a/t/t4001-diff-rename.sh b/t/t4001-diff-rename.sh
> index c16486a9d41..2f9700742aa 100755
> --- a/t/t4001-diff-rename.sh
> +++ b/t/t4001-diff-rename.sh
> @@ -7,7 +7,7 @@ test_description='Test rename detection in diff engine.
>
>  '
>  . ./test-lib.sh
> -. "$TEST_DIRECTORY"/diff-lib.sh
> +. "$TEST_DIRECTORY"/lib-diff.sh
>
>  test_expect_success 'setup' '
>  	cat >path0 <<-\EOF &&
> diff --git a/t/t4003-diff-rename-1.sh b/t/t4003-diff-rename-1.sh
> index df2accb6555..db07ff3eb19 100755
> --- a/t/t4003-diff-rename-1.sh
> +++ b/t/t4003-diff-rename-1.sh
> @@ -7,11 +7,11 @@ test_description='More rename detection
>
>  '
>  . ./test-lib.sh
> -. "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash
> +. "$TEST_DIRECTORY"/lib-diff.sh ;# test-lib chdir's into trash
>
>  test_expect_success \
>      'prepare reference tree' \
> -    'cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
> +    'cat "$TEST_DIRECTORY"/lib-diff/COPYING >COPYING &&
>       echo frotz >rezrov &&
>      git update-index --add COPYING rezrov &&
>      tree=$(git write-tree) &&
> @@ -99,7 +99,7 @@ test_expect_success \
>
>  test_expect_success \
>      'prepare work tree once again' \
> -    'cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
> +    'cat "$TEST_DIRECTORY"/lib-diff/COPYING >COPYING &&
>       git update-index --add --remove COPYING COPYING.1'
>
>  # tree has COPYING and rezrov.  work tree has COPYING and COPYING.1,
> diff --git a/t/t4004-diff-rename-symlink.sh b/t/t4004-diff-rename-symlink.sh
> index 6e562c80d12..3d495e37bb1 100755
> --- a/t/t4004-diff-rename-symlink.sh
> +++ b/t/t4004-diff-rename-symlink.sh
> @@ -10,7 +10,7 @@ copy of symbolic links, but should not produce rename/copy followed
>  by an edit for them.
>  '
>  . ./test-lib.sh
> -. "$TEST_DIRECTORY"/diff-lib.sh
> +. "$TEST_DIRECTORY"/lib-diff.sh
>
>  test_expect_success SYMLINKS \
>      'prepare reference tree' \
> diff --git a/t/t4005-diff-rename-2.sh b/t/t4005-diff-rename-2.sh
> index d18a80493c2..86479061325 100755
> --- a/t/t4005-diff-rename-2.sh
> +++ b/t/t4005-diff-rename-2.sh
> @@ -6,10 +6,10 @@
>  test_description='Same rename detection as t4003 but testing diff-raw.'
>
>  . ./test-lib.sh
> -. "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash
> +. "$TEST_DIRECTORY"/lib-diff.sh ;# test-lib chdir's into trash
>
>  test_expect_success 'setup reference tree' '
> -	cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
> +	cat "$TEST_DIRECTORY"/lib-diff/COPYING >COPYING &&
>  	echo frotz >rezrov &&
>  	git update-index --add COPYING rezrov &&
>  	tree=$(git write-tree) &&
> @@ -64,7 +64,7 @@ test_expect_success 'validate output from rename/copy detection (#2)' '
>  # nows how to say Copy.
>
>  test_expect_success 'validate output from rename/copy detection (#3)' '
> -	cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
> +	cat "$TEST_DIRECTORY"/lib-diff/COPYING >COPYING &&
>  	git update-index --add --remove COPYING COPYING.1 &&
>
>  	cat <<-EOF >expected &&
> diff --git a/t/t4007-rename-3.sh b/t/t4007-rename-3.sh
> index b187b7f6c66..cbb9c62f535 100755
> --- a/t/t4007-rename-3.sh
> +++ b/t/t4007-rename-3.sh
> @@ -7,17 +7,17 @@ test_description='Rename interaction with pathspec.
>
>  '
>  . ./test-lib.sh
> -. "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash
> +. "$TEST_DIRECTORY"/lib-diff.sh ;# test-lib chdir's into trash
>
>  test_expect_success 'prepare reference tree' '
>  	mkdir path0 path1 &&
> -	cp "$TEST_DIRECTORY"/diff-lib/COPYING path0/COPYING &&
> +	cp "$TEST_DIRECTORY"/lib-diff/COPYING path0/COPYING &&
>  	git update-index --add path0/COPYING &&
>  	tree=$(git write-tree) &&
>  	echo $tree
>  '
>
> -blob=$(git hash-object "$TEST_DIRECTORY/diff-lib/COPYING")
> +blob=$(git hash-object "$TEST_DIRECTORY/lib-diff/COPYING")
>  test_expect_success 'prepare work tree' '
>  	cp path0/COPYING path1/COPYING &&
>  	git update-index --add --remove path0/COPYING path1/COPYING
> diff --git a/t/t4008-diff-break-rewrite.sh b/t/t4008-diff-break-rewrite.sh
> index b1ccd4102e0..2299f27511b 100755
> --- a/t/t4008-diff-break-rewrite.sh
> +++ b/t/t4008-diff-break-rewrite.sh
> @@ -22,11 +22,11 @@ With -B, this should be detected as two complete rewrites.
>  Further, with -B and -M together, these should turn into two renames.
>  '
>  . ./test-lib.sh
> -. "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash
> +. "$TEST_DIRECTORY"/lib-diff.sh ;# test-lib chdir's into trash
>
>  test_expect_success setup '
> -	cat "$TEST_DIRECTORY"/diff-lib/README >file0 &&
> -	cat "$TEST_DIRECTORY"/diff-lib/COPYING >file1 &&
> +	cat "$TEST_DIRECTORY"/lib-diff/README >file0 &&
> +	cat "$TEST_DIRECTORY"/lib-diff/COPYING >file1 &&
>  	blob0_id=$(git hash-object file0) &&
>  	blob1_id=$(git hash-object file1) &&
>  	git update-index --add file0 file1 &&
> diff --git a/t/t4009-diff-rename-4.sh b/t/t4009-diff-rename-4.sh
> index b63bdf031f5..b1da807f169 100755
> --- a/t/t4009-diff-rename-4.sh
> +++ b/t/t4009-diff-rename-4.sh
> @@ -7,11 +7,11 @@ test_description='Same rename detection as t4003 but testing diff-raw -z.
>
>  '
>  . ./test-lib.sh
> -. "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash
> +. "$TEST_DIRECTORY"/lib-diff.sh ;# test-lib chdir's into trash
>
>  test_expect_success \
>      'prepare reference tree' \
> -    'cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
> +    'cat "$TEST_DIRECTORY"/lib-diff/COPYING >COPYING &&
>       echo frotz >rezrov &&
>      git update-index --add COPYING rezrov &&
>      orig=$(git hash-object COPYING) &&
> @@ -81,7 +81,7 @@ test_expect_success \
>
>  test_expect_success \
>      'prepare work tree once again' \
> -    'cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
> +    'cat "$TEST_DIRECTORY"/lib-diff/COPYING >COPYING &&
>       git update-index --add --remove COPYING COPYING.1'
>
>  git diff-index -z -C --find-copies-harder $tree >current
> diff --git a/t/t4010-diff-pathspec.sh b/t/t4010-diff-pathspec.sh
> index 65cc703c659..1bbced79ece 100755
> --- a/t/t4010-diff-pathspec.sh
> +++ b/t/t4010-diff-pathspec.sh
> @@ -10,7 +10,7 @@ Prepare:
>          path1/file1
>  '
>  . ./test-lib.sh
> -. "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash
> +. "$TEST_DIRECTORY"/lib-diff.sh ;# test-lib chdir's into trash
>
>  test_expect_success \
>      setup \
> diff --git a/t/t4011-diff-symlink.sh b/t/t4011-diff-symlink.sh
> index 717034bb50b..5a25c259fe3 100755
> --- a/t/t4011-diff-symlink.sh
> +++ b/t/t4011-diff-symlink.sh
> @@ -7,7 +7,7 @@ test_description='Test diff of symlinks.
>
>  '
>  . ./test-lib.sh
> -. "$TEST_DIRECTORY"/diff-lib.sh
> +. "$TEST_DIRECTORY"/lib-diff.sh
>
>  # Print the short OID of a symlink with the given name.
>  symlink_oid () {
> diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh
> index ce6aa3914fe..fcc30d8cc26 100755
> --- a/t/t4013-diff-various.sh
> +++ b/t/t4013-diff-various.sh
> @@ -9,7 +9,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
>  export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
>
>  . ./test-lib.sh
> -. "$TEST_DIRECTORY"/diff-lib.sh
> +. "$TEST_DIRECTORY"/lib-diff.sh
>
>  test_expect_success setup '
>
> diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh
> index 8c574221b27..2c13b62d3c6 100755
> --- a/t/t4015-diff-whitespace.sh
> +++ b/t/t4015-diff-whitespace.sh
> @@ -7,7 +7,7 @@ test_description='Test special whitespace in diff engine.
>
>  '
>  . ./test-lib.sh
> -. "$TEST_DIRECTORY"/diff-lib.sh
> +. "$TEST_DIRECTORY"/lib-diff.sh
>
>  test_expect_success "Ray Lehtiniemi's example" '
>  	cat <<-\EOF >x &&
> diff --git a/t/t4027-diff-submodule.sh b/t/t4027-diff-submodule.sh
> index 894a11b224d..94ef77e1dfe 100755
> --- a/t/t4027-diff-submodule.sh
> +++ b/t/t4027-diff-submodule.sh
> @@ -3,7 +3,7 @@
>  test_description='difference in submodules'
>
>  . ./test-lib.sh
> -. "$TEST_DIRECTORY"/diff-lib.sh
> +. "$TEST_DIRECTORY"/lib-diff.sh
>
>  test_expect_success setup '
>  	test_tick &&
> diff --git a/t/t4034-diff-words.sh b/t/t4034-diff-words.sh
> index 0c8fb39ceda..56f1e62a97b 100755
> --- a/t/t4034-diff-words.sh
> +++ b/t/t4034-diff-words.sh
> @@ -3,7 +3,7 @@
>  test_description='word diff colors'
>
>  . ./test-lib.sh
> -. "$TEST_DIRECTORY"/diff-lib.sh
> +. "$TEST_DIRECTORY"/lib-diff.sh
>
>  cat >pre.simple <<-\EOF
>  	h(4)
> diff --git a/t/t4038-diff-combined.sh b/t/t4038-diff-combined.sh
> index 09ad491a593..aeac203c424 100755
> --- a/t/t4038-diff-combined.sh
> +++ b/t/t4038-diff-combined.sh
> @@ -6,7 +6,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
>  export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
>
>  . ./test-lib.sh
> -. "$TEST_DIRECTORY"/diff-lib.sh
> +. "$TEST_DIRECTORY"/lib-diff.sh
>
>  setup_helper () {
>  	one=$1 branch=$2 side=$3 &&
> diff --git a/t/t4061-diff-indent.sh b/t/t4061-diff-indent.sh
> index bcf7493740a..7750b87ca16 100755
> --- a/t/t4061-diff-indent.sh
> +++ b/t/t4061-diff-indent.sh
> @@ -7,7 +7,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
>  export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
>
>  . ./test-lib.sh
> -. "$TEST_DIRECTORY"/diff-lib.sh
> +. "$TEST_DIRECTORY"/lib-diff.sh
>
>  # Compare two diff outputs. Ignore "index" lines, because we don't
>  # care about SHA-1s or file modes.
> diff --git a/t/t4206-log-follow-harder-copies.sh b/t/t4206-log-follow-harder-copies.sh
> index ad29e65fcba..4871a5dc92f 100755
> --- a/t/t4206-log-follow-harder-copies.sh
> +++ b/t/t4206-log-follow-harder-copies.sh
> @@ -7,7 +7,7 @@ test_description='Test --follow should always find copies hard in git log.
>
>  '
>  . ./test-lib.sh
> -. "$TEST_DIRECTORY"/diff-lib.sh
> +. "$TEST_DIRECTORY"/lib-diff.sh
>
>  echo >path0 'Line 1
>  Line 2
> diff --git a/t/t7501-commit-basic-functionality.sh b/t/t7501-commit-basic-functionality.sh
> index 0f936182e4f..512ae2781fe 100755
> --- a/t/t7501-commit-basic-functionality.sh
> +++ b/t/t7501-commit-basic-functionality.sh
> @@ -11,7 +11,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
>  export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
>
>  . ./test-lib.sh
> -. "$TEST_DIRECTORY/diff-lib.sh"
> +. "$TEST_DIRECTORY/lib-diff.sh"
>
>  author='The Real Author <someguy@his.email.org>'
>
> diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
> index 3d17e932a0e..3d77701fd4d 100755
> --- a/t/t9300-fast-import.sh
> +++ b/t/t9300-fast-import.sh
> @@ -8,7 +8,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
>  export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
>
>  . ./test-lib.sh
> -. "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash
> +. "$TEST_DIRECTORY"/lib-diff.sh ;# test-lib chdir's into trash
>
>  verify_packs () {
>  	for p in .git/objects/pack/*.pack
> --
> 2.30.0.284.gd98b1dd5eaa7
>
>
Junio C Hamano Feb. 11, 2021, 10:45 p.m. UTC | #3
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> Hi Ævar,
>
> On Tue, 9 Feb 2021, Ævar Arnfjörð Bjarmason wrote:
>
>> diff --git a/t/.gitattributes b/t/.gitattributes
>> index d778bfad052..dafa17c3e61 100644
>> --- a/t/.gitattributes
>> +++ b/t/.gitattributes
>> @@ -1,6 +1,6 @@
>>  t[0-9][0-9][0-9][0-9]/* -whitespace
>>  /chainlint/*.expect eol=lf
>> -/diff-lib/* eol=lf
>> +/lib-diff/* eol=lf
>>  /t0110/url-* binary
>>  /t3206/* eol=lf
>>  /t3900/*.txt eol=lf
>
> Lucky coincidence that this is still sorted ;-)
>
> The patch looks good to me. Thanks!
> Dscho

Yup.  It still needs to be signed off.
diff mbox series

Patch

diff --git a/t/.gitattributes b/t/.gitattributes
index d778bfad052..dafa17c3e61 100644
--- a/t/.gitattributes
+++ b/t/.gitattributes
@@ -1,6 +1,6 @@ 
 t[0-9][0-9][0-9][0-9]/* -whitespace
 /chainlint/*.expect eol=lf
-/diff-lib/* eol=lf
+/lib-diff/* eol=lf
 /t0110/url-* binary
 /t3206/* eol=lf
 /t3900/*.txt eol=lf
diff --git a/t/diff-lib.sh b/t/lib-diff.sh
similarity index 100%
rename from t/diff-lib.sh
rename to t/lib-diff.sh
diff --git a/t/diff-lib/COPYING b/t/lib-diff/COPYING
similarity index 100%
rename from t/diff-lib/COPYING
rename to t/lib-diff/COPYING
diff --git a/t/diff-lib/README b/t/lib-diff/README
similarity index 100%
rename from t/diff-lib/README
rename to t/lib-diff/README
diff --git a/t/t4000-diff-format.sh b/t/t4000-diff-format.sh
index e5116a76a1c..cce334981e1 100755
--- a/t/t4000-diff-format.sh
+++ b/t/t4000-diff-format.sh
@@ -7,7 +7,7 @@  test_description='Test built-in diff output engine.
 
 '
 . ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh
+. "$TEST_DIRECTORY"/lib-diff.sh
 
 echo >path0 'Line 1
 Line 2
diff --git a/t/t4001-diff-rename.sh b/t/t4001-diff-rename.sh
index c16486a9d41..2f9700742aa 100755
--- a/t/t4001-diff-rename.sh
+++ b/t/t4001-diff-rename.sh
@@ -7,7 +7,7 @@  test_description='Test rename detection in diff engine.
 
 '
 . ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh
+. "$TEST_DIRECTORY"/lib-diff.sh
 
 test_expect_success 'setup' '
 	cat >path0 <<-\EOF &&
diff --git a/t/t4003-diff-rename-1.sh b/t/t4003-diff-rename-1.sh
index df2accb6555..db07ff3eb19 100755
--- a/t/t4003-diff-rename-1.sh
+++ b/t/t4003-diff-rename-1.sh
@@ -7,11 +7,11 @@  test_description='More rename detection
 
 '
 . ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash
+. "$TEST_DIRECTORY"/lib-diff.sh ;# test-lib chdir's into trash
 
 test_expect_success \
     'prepare reference tree' \
-    'cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
+    'cat "$TEST_DIRECTORY"/lib-diff/COPYING >COPYING &&
      echo frotz >rezrov &&
     git update-index --add COPYING rezrov &&
     tree=$(git write-tree) &&
@@ -99,7 +99,7 @@  test_expect_success \
 
 test_expect_success \
     'prepare work tree once again' \
-    'cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
+    'cat "$TEST_DIRECTORY"/lib-diff/COPYING >COPYING &&
      git update-index --add --remove COPYING COPYING.1'
 
 # tree has COPYING and rezrov.  work tree has COPYING and COPYING.1,
diff --git a/t/t4004-diff-rename-symlink.sh b/t/t4004-diff-rename-symlink.sh
index 6e562c80d12..3d495e37bb1 100755
--- a/t/t4004-diff-rename-symlink.sh
+++ b/t/t4004-diff-rename-symlink.sh
@@ -10,7 +10,7 @@  copy of symbolic links, but should not produce rename/copy followed
 by an edit for them.
 '
 . ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh
+. "$TEST_DIRECTORY"/lib-diff.sh
 
 test_expect_success SYMLINKS \
     'prepare reference tree' \
diff --git a/t/t4005-diff-rename-2.sh b/t/t4005-diff-rename-2.sh
index d18a80493c2..86479061325 100755
--- a/t/t4005-diff-rename-2.sh
+++ b/t/t4005-diff-rename-2.sh
@@ -6,10 +6,10 @@ 
 test_description='Same rename detection as t4003 but testing diff-raw.'
 
 . ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash
+. "$TEST_DIRECTORY"/lib-diff.sh ;# test-lib chdir's into trash
 
 test_expect_success 'setup reference tree' '
-	cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
+	cat "$TEST_DIRECTORY"/lib-diff/COPYING >COPYING &&
 	echo frotz >rezrov &&
 	git update-index --add COPYING rezrov &&
 	tree=$(git write-tree) &&
@@ -64,7 +64,7 @@  test_expect_success 'validate output from rename/copy detection (#2)' '
 # nows how to say Copy.
 
 test_expect_success 'validate output from rename/copy detection (#3)' '
-	cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
+	cat "$TEST_DIRECTORY"/lib-diff/COPYING >COPYING &&
 	git update-index --add --remove COPYING COPYING.1 &&
 
 	cat <<-EOF >expected &&
diff --git a/t/t4007-rename-3.sh b/t/t4007-rename-3.sh
index b187b7f6c66..cbb9c62f535 100755
--- a/t/t4007-rename-3.sh
+++ b/t/t4007-rename-3.sh
@@ -7,17 +7,17 @@  test_description='Rename interaction with pathspec.
 
 '
 . ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash
+. "$TEST_DIRECTORY"/lib-diff.sh ;# test-lib chdir's into trash
 
 test_expect_success 'prepare reference tree' '
 	mkdir path0 path1 &&
-	cp "$TEST_DIRECTORY"/diff-lib/COPYING path0/COPYING &&
+	cp "$TEST_DIRECTORY"/lib-diff/COPYING path0/COPYING &&
 	git update-index --add path0/COPYING &&
 	tree=$(git write-tree) &&
 	echo $tree
 '
 
-blob=$(git hash-object "$TEST_DIRECTORY/diff-lib/COPYING")
+blob=$(git hash-object "$TEST_DIRECTORY/lib-diff/COPYING")
 test_expect_success 'prepare work tree' '
 	cp path0/COPYING path1/COPYING &&
 	git update-index --add --remove path0/COPYING path1/COPYING
diff --git a/t/t4008-diff-break-rewrite.sh b/t/t4008-diff-break-rewrite.sh
index b1ccd4102e0..2299f27511b 100755
--- a/t/t4008-diff-break-rewrite.sh
+++ b/t/t4008-diff-break-rewrite.sh
@@ -22,11 +22,11 @@  With -B, this should be detected as two complete rewrites.
 Further, with -B and -M together, these should turn into two renames.
 '
 . ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash
+. "$TEST_DIRECTORY"/lib-diff.sh ;# test-lib chdir's into trash
 
 test_expect_success setup '
-	cat "$TEST_DIRECTORY"/diff-lib/README >file0 &&
-	cat "$TEST_DIRECTORY"/diff-lib/COPYING >file1 &&
+	cat "$TEST_DIRECTORY"/lib-diff/README >file0 &&
+	cat "$TEST_DIRECTORY"/lib-diff/COPYING >file1 &&
 	blob0_id=$(git hash-object file0) &&
 	blob1_id=$(git hash-object file1) &&
 	git update-index --add file0 file1 &&
diff --git a/t/t4009-diff-rename-4.sh b/t/t4009-diff-rename-4.sh
index b63bdf031f5..b1da807f169 100755
--- a/t/t4009-diff-rename-4.sh
+++ b/t/t4009-diff-rename-4.sh
@@ -7,11 +7,11 @@  test_description='Same rename detection as t4003 but testing diff-raw -z.
 
 '
 . ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash
+. "$TEST_DIRECTORY"/lib-diff.sh ;# test-lib chdir's into trash
 
 test_expect_success \
     'prepare reference tree' \
-    'cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
+    'cat "$TEST_DIRECTORY"/lib-diff/COPYING >COPYING &&
      echo frotz >rezrov &&
     git update-index --add COPYING rezrov &&
     orig=$(git hash-object COPYING) &&
@@ -81,7 +81,7 @@  test_expect_success \
 
 test_expect_success \
     'prepare work tree once again' \
-    'cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
+    'cat "$TEST_DIRECTORY"/lib-diff/COPYING >COPYING &&
      git update-index --add --remove COPYING COPYING.1'
 
 git diff-index -z -C --find-copies-harder $tree >current
diff --git a/t/t4010-diff-pathspec.sh b/t/t4010-diff-pathspec.sh
index 65cc703c659..1bbced79ece 100755
--- a/t/t4010-diff-pathspec.sh
+++ b/t/t4010-diff-pathspec.sh
@@ -10,7 +10,7 @@  Prepare:
         path1/file1
 '
 . ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash
+. "$TEST_DIRECTORY"/lib-diff.sh ;# test-lib chdir's into trash
 
 test_expect_success \
     setup \
diff --git a/t/t4011-diff-symlink.sh b/t/t4011-diff-symlink.sh
index 717034bb50b..5a25c259fe3 100755
--- a/t/t4011-diff-symlink.sh
+++ b/t/t4011-diff-symlink.sh
@@ -7,7 +7,7 @@  test_description='Test diff of symlinks.
 
 '
 . ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh
+. "$TEST_DIRECTORY"/lib-diff.sh
 
 # Print the short OID of a symlink with the given name.
 symlink_oid () {
diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh
index ce6aa3914fe..fcc30d8cc26 100755
--- a/t/t4013-diff-various.sh
+++ b/t/t4013-diff-various.sh
@@ -9,7 +9,7 @@  GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh
+. "$TEST_DIRECTORY"/lib-diff.sh
 
 test_expect_success setup '
 
diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh
index 8c574221b27..2c13b62d3c6 100755
--- a/t/t4015-diff-whitespace.sh
+++ b/t/t4015-diff-whitespace.sh
@@ -7,7 +7,7 @@  test_description='Test special whitespace in diff engine.
 
 '
 . ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh
+. "$TEST_DIRECTORY"/lib-diff.sh
 
 test_expect_success "Ray Lehtiniemi's example" '
 	cat <<-\EOF >x &&
diff --git a/t/t4027-diff-submodule.sh b/t/t4027-diff-submodule.sh
index 894a11b224d..94ef77e1dfe 100755
--- a/t/t4027-diff-submodule.sh
+++ b/t/t4027-diff-submodule.sh
@@ -3,7 +3,7 @@ 
 test_description='difference in submodules'
 
 . ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh
+. "$TEST_DIRECTORY"/lib-diff.sh
 
 test_expect_success setup '
 	test_tick &&
diff --git a/t/t4034-diff-words.sh b/t/t4034-diff-words.sh
index 0c8fb39ceda..56f1e62a97b 100755
--- a/t/t4034-diff-words.sh
+++ b/t/t4034-diff-words.sh
@@ -3,7 +3,7 @@ 
 test_description='word diff colors'
 
 . ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh
+. "$TEST_DIRECTORY"/lib-diff.sh
 
 cat >pre.simple <<-\EOF
 	h(4)
diff --git a/t/t4038-diff-combined.sh b/t/t4038-diff-combined.sh
index 09ad491a593..aeac203c424 100755
--- a/t/t4038-diff-combined.sh
+++ b/t/t4038-diff-combined.sh
@@ -6,7 +6,7 @@  GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh
+. "$TEST_DIRECTORY"/lib-diff.sh
 
 setup_helper () {
 	one=$1 branch=$2 side=$3 &&
diff --git a/t/t4061-diff-indent.sh b/t/t4061-diff-indent.sh
index bcf7493740a..7750b87ca16 100755
--- a/t/t4061-diff-indent.sh
+++ b/t/t4061-diff-indent.sh
@@ -7,7 +7,7 @@  GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh
+. "$TEST_DIRECTORY"/lib-diff.sh
 
 # Compare two diff outputs. Ignore "index" lines, because we don't
 # care about SHA-1s or file modes.
diff --git a/t/t4206-log-follow-harder-copies.sh b/t/t4206-log-follow-harder-copies.sh
index ad29e65fcba..4871a5dc92f 100755
--- a/t/t4206-log-follow-harder-copies.sh
+++ b/t/t4206-log-follow-harder-copies.sh
@@ -7,7 +7,7 @@  test_description='Test --follow should always find copies hard in git log.
 
 '
 . ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh
+. "$TEST_DIRECTORY"/lib-diff.sh
 
 echo >path0 'Line 1
 Line 2
diff --git a/t/t7501-commit-basic-functionality.sh b/t/t7501-commit-basic-functionality.sh
index 0f936182e4f..512ae2781fe 100755
--- a/t/t7501-commit-basic-functionality.sh
+++ b/t/t7501-commit-basic-functionality.sh
@@ -11,7 +11,7 @@  GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
-. "$TEST_DIRECTORY/diff-lib.sh"
+. "$TEST_DIRECTORY/lib-diff.sh"
 
 author='The Real Author <someguy@his.email.org>'
 
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index 3d17e932a0e..3d77701fd4d 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -8,7 +8,7 @@  GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
 . ./test-lib.sh
-. "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash
+. "$TEST_DIRECTORY"/lib-diff.sh ;# test-lib chdir's into trash
 
 verify_packs () {
 	for p in .git/objects/pack/*.pack