Git development
 help / color / mirror / Atom feed
* [PATCH] submodule absorbgitdirs tests: use test_* helper functions
@ 2026-06-30  2:02 Bryan B. Lima
  2026-06-30 18:00 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Bryan B. Lima @ 2026-06-30  2:02 UTC (permalink / raw)
  To: git
  Cc: bblima, gustavoscorrea, Ævar Arnfjörð Bjarmason,
	Junio C Hamano

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>
---
 t/t7412-submodule-absorbgitdirs.sh | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/t/t7412-submodule-absorbgitdirs.sh b/t/t7412-submodule-absorbgitdirs.sh
index 0490499573..bd1c684480 100755
--- a/t/t7412-submodule-absorbgitdirs.sh
+++ b/t/t7412-submodule-absorbgitdirs.sh
@@ -34,8 +34,8 @@ test_expect_success 'absorb the git dir' '
 	git submodule absorbgitdirs 2>actual &&
 	test_cmp expect actual &&
 	git fsck &&
-	test -f sub1/.git &&
-	test -d .git/modules/sub1 &&
+	test_path_is_file sub1/.git &&
+	test_path_is_dir .git/modules/sub1 &&
 	git status >actual.1 &&
 	git -C sub1 rev-parse HEAD >actual.2 &&
 	test_cmp expect.1 actual.1 &&
@@ -47,9 +47,9 @@ test_expect_success 'absorbing does not fail for deinitialized submodules' '
 	git submodule deinit --all &&
 	git submodule absorbgitdirs 2>err &&
 	test_must_be_empty err &&
-	test -d .git/modules/sub1 &&
-	test -d sub1 &&
-	! test -e sub1/.git
+	test_path_is_dir .git/modules/sub1 &&
+	test_path_is_dir sub1 &&
+	test_path_is_missing sub1/.git
 '
 
 test_expect_success 'setup nested submodule' '
@@ -72,8 +72,8 @@ test_expect_success 'absorb the git dir in a nested submodule' '
 	EOF
 	git submodule absorbgitdirs 2>actual &&
 	test_cmp expect actual &&
-	test -f sub1/nested/.git &&
-	test -d .git/modules/sub1/modules/nested &&
+	test_path_is_file sub1/nested/.git &&
+	test_path_is_dir .git/modules/sub1/modules/nested &&
 	git status >actual.1 &&
 	git -C sub1/nested rev-parse HEAD >actual.2 &&
 	test_cmp expect.1 actual.1 &&
@@ -109,9 +109,9 @@ test_expect_success 'absorb the git dir in a nested submodule' '
 	EOF
 	git submodule absorbgitdirs 2>actual &&
 	test_cmp expect actual &&
-	test -f sub1/.git &&
-	test -f sub1/nested/.git &&
-	test -d .git/modules/sub1/modules/nested &&
+	test_path_is_file sub1/.git &&
+	test_path_is_file sub1/nested/.git &&
+	test_path_is_dir .git/modules/sub1/modules/nested &&
 	git status >actual.1 &&
 	git -C sub1/nested rev-parse HEAD >actual.2 &&
 	test_cmp expect.1 actual.1 &&
@@ -155,7 +155,7 @@ test_expect_success 'absorbing the git dir fails for incomplete submodules' '
 	test_must_fail git submodule absorbgitdirs 2>actual &&
 	test_cmp expect actual &&
 	git -C sub2 fsck &&
-	test -d sub2/.git &&
+	test_path_is_dir sub2/.git &&
 	git status >actual &&
 	git -C sub2 rev-parse HEAD >actual.2 &&
 	test_cmp expect.1 actual.1 &&

base-commit: e9019fcafe0040228b8631c30f97ae1adb61bcdc
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] submodule absorbgitdirs tests: use test_* helper functions
  2026-06-30  2:02 [PATCH] submodule absorbgitdirs tests: use test_* helper functions Bryan B. Lima
@ 2026-06-30 18:00 ` Junio C Hamano
  2026-07-01  8:04   ` Patrick Steinhardt
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2026-06-30 18:00 UTC (permalink / raw)
  To: Bryan B. Lima; +Cc: git, gustavoscorrea, Ævar Arnfjörð Bjarmason

"Bryan B. Lima" <bblima@usp.br> writes:

> 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>
> ---
>  t/t7412-submodule-absorbgitdirs.sh | 22 +++++++++++-----------
>  1 file changed, 11 insertions(+), 11 deletions(-)

Welcome to the Git development community.

It is rare, but it happens from time to time, that we see a patch by
somebody we haven't seen on this list, and the patch looks perfect.
Very delighted.

Will queue.  Thanks.

> diff --git a/t/t7412-submodule-absorbgitdirs.sh b/t/t7412-submodule-absorbgitdirs.sh
> index 0490499573..bd1c684480 100755
> --- a/t/t7412-submodule-absorbgitdirs.sh
> +++ b/t/t7412-submodule-absorbgitdirs.sh
> @@ -34,8 +34,8 @@ test_expect_success 'absorb the git dir' '
>  	git submodule absorbgitdirs 2>actual &&
>  	test_cmp expect actual &&
>  	git fsck &&
> -	test -f sub1/.git &&
> -	test -d .git/modules/sub1 &&
> +	test_path_is_file sub1/.git &&
> +	test_path_is_dir .git/modules/sub1 &&
>  	git status >actual.1 &&
>  	git -C sub1 rev-parse HEAD >actual.2 &&
>  	test_cmp expect.1 actual.1 &&
> @@ -47,9 +47,9 @@ test_expect_success 'absorbing does not fail for deinitialized submodules' '
>  	git submodule deinit --all &&
>  	git submodule absorbgitdirs 2>err &&
>  	test_must_be_empty err &&
> -	test -d .git/modules/sub1 &&
> -	test -d sub1 &&
> -	! test -e sub1/.git
> +	test_path_is_dir .git/modules/sub1 &&
> +	test_path_is_dir sub1 &&
> +	test_path_is_missing sub1/.git
>  '
>  
>  test_expect_success 'setup nested submodule' '
> @@ -72,8 +72,8 @@ test_expect_success 'absorb the git dir in a nested submodule' '
>  	EOF
>  	git submodule absorbgitdirs 2>actual &&
>  	test_cmp expect actual &&
> -	test -f sub1/nested/.git &&
> -	test -d .git/modules/sub1/modules/nested &&
> +	test_path_is_file sub1/nested/.git &&
> +	test_path_is_dir .git/modules/sub1/modules/nested &&
>  	git status >actual.1 &&
>  	git -C sub1/nested rev-parse HEAD >actual.2 &&
>  	test_cmp expect.1 actual.1 &&
> @@ -109,9 +109,9 @@ test_expect_success 'absorb the git dir in a nested submodule' '
>  	EOF
>  	git submodule absorbgitdirs 2>actual &&
>  	test_cmp expect actual &&
> -	test -f sub1/.git &&
> -	test -f sub1/nested/.git &&
> -	test -d .git/modules/sub1/modules/nested &&
> +	test_path_is_file sub1/.git &&
> +	test_path_is_file sub1/nested/.git &&
> +	test_path_is_dir .git/modules/sub1/modules/nested &&
>  	git status >actual.1 &&
>  	git -C sub1/nested rev-parse HEAD >actual.2 &&
>  	test_cmp expect.1 actual.1 &&
> @@ -155,7 +155,7 @@ test_expect_success 'absorbing the git dir fails for incomplete submodules' '
>  	test_must_fail git submodule absorbgitdirs 2>actual &&
>  	test_cmp expect actual &&
>  	git -C sub2 fsck &&
> -	test -d sub2/.git &&
> +	test_path_is_dir sub2/.git &&
>  	git status >actual &&
>  	git -C sub2 rev-parse HEAD >actual.2 &&
>  	test_cmp expect.1 actual.1 &&
>
> base-commit: e9019fcafe0040228b8631c30f97ae1adb61bcdc

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] submodule absorbgitdirs tests: use test_* helper functions
  2026-06-30 18:00 ` Junio C Hamano
@ 2026-07-01  8:04   ` Patrick Steinhardt
  0 siblings, 0 replies; 3+ messages in thread
From: Patrick Steinhardt @ 2026-07-01  8:04 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Bryan B. Lima, git, gustavoscorrea,
	Ævar Arnfjörð Bjarmason

On Tue, Jun 30, 2026 at 11:00:28AM -0700, Junio C Hamano wrote:
> "Bryan B. Lima" <bblima@usp.br> writes:
> 
> > 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>
> > ---
> >  t/t7412-submodule-absorbgitdirs.sh | 22 +++++++++++-----------
> >  1 file changed, 11 insertions(+), 11 deletions(-)
> 
> Welcome to the Git development community.

Welcome indeed!

> It is rare, but it happens from time to time, that we see a patch by
> somebody we haven't seen on this list, and the patch looks perfect.
> Very delighted.

Sorry to spoil it: the order of SOBs is incorrect. The patch is authored
by Bryan, so that signoff needs to come last.

The patch itself looks good though, thanks!

Patrick

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-07-01  8:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-30  2:02 [PATCH] submodule absorbgitdirs tests: use test_* helper functions Bryan B. Lima
2026-06-30 18:00 ` Junio C Hamano
2026-07-01  8:04   ` Patrick Steinhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox