submodule absorbgitdirs tests: use test_* helper functions

Use modern helper functions from test-lib-functions.sh to provide nice error messages. Signed-off-by: Bryan B. Lima <bblima@usp.br> Co-authored-by: Gustavo S. Correa <gustavoscorrea@usp.br> Signed-off-by: Gustavo S. Correa <gustavoscorrea@usp.br> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Bryan B. Lima committed Jun 29, 2026 at 23:02 UTC 0a700eae48a70d8e5a5177c73b7da64e00e57a45
1 file changed +11 -11
t/t7412-submodule-absorbgitdirs.sh
+11 -11
@@ -34,8 +34,8 @@ test_expect_success 'absorb the git dir' '
34 git submodule absorbgitdirs 2>actual &&
35 test_cmp expect actual &&
36 git fsck &&
37 - test -f sub1/.git &&
38 - test -d .git/modules/sub1 &&
37 + test_path_is_file sub1/.git &&
38 + test_path_is_dir .git/modules/sub1 &&
39 git status >actual.1 &&
40 git -C sub1 rev-parse HEAD >actual.2 &&
41 test_cmp expect.1 actual.1 &&
@@ -47,9 +47,9 @@ test_expect_success 'absorbing does not fail for deinitialized submodules' '
47 git submodule deinit --all &&
48 git submodule absorbgitdirs 2>err &&
49 test_must_be_empty err &&
50 - test -d .git/modules/sub1 &&
51 - test -d sub1 &&
52 - ! test -e sub1/.git
50 + test_path_is_dir .git/modules/sub1 &&
51 + test_path_is_dir sub1 &&
52 + test_path_is_missing sub1/.git
53 '
54
55 test_expect_success 'setup nested submodule' '
@@ -72,8 +72,8 @@ test_expect_success 'absorb the git dir in a nested submodule' '
72 EOF
73 git submodule absorbgitdirs 2>actual &&
74 test_cmp expect actual &&
75 - test -f sub1/nested/.git &&
76 - test -d .git/modules/sub1/modules/nested &&
75 + test_path_is_file sub1/nested/.git &&
76 + test_path_is_dir .git/modules/sub1/modules/nested &&
77 git status >actual.1 &&
78 git -C sub1/nested rev-parse HEAD >actual.2 &&
79 test_cmp expect.1 actual.1 &&
@@ -109,9 +109,9 @@ test_expect_success 'absorb the git dir in a nested submodule' '
109 EOF
110 git submodule absorbgitdirs 2>actual &&
111 test_cmp expect actual &&
112 - test -f sub1/.git &&
113 - test -f sub1/nested/.git &&
114 - test -d .git/modules/sub1/modules/nested &&
112 + test_path_is_file sub1/.git &&
113 + test_path_is_file sub1/nested/.git &&
114 + test_path_is_dir .git/modules/sub1/modules/nested &&
115 git status >actual.1 &&
116 git -C sub1/nested rev-parse HEAD >actual.2 &&
117 test_cmp expect.1 actual.1 &&
@@ -155,7 +155,7 @@ test_expect_success 'absorbing the git dir fails for incomplete submodules' '
155 test_must_fail git submodule absorbgitdirs 2>actual &&
156 test_cmp expect actual &&
157 git -C sub2 fsck &&
158 - test -d sub2/.git &&
158 + test_path_is_dir sub2/.git &&
159 git status >actual &&
160 git -C sub2 rev-parse HEAD >actual.2 &&
161 test_cmp expect.1 actual.1 &&