diff mbox series

[v2,20/21] t4202: mark bogus head hash test with REFFILES

Message ID a33cdfda74ff55fbc8242d3486e1fd5a26ad4c00.1619519903.git.gitgitgadget@gmail.com (mailing list archive)
State New, archived
Headers show
Series Prepare tests for reftable backend | expand

Commit Message

Han-Wen Nienhuys April 27, 2021, 10:38 a.m. UTC
From: Han-Wen Nienhuys <hanwen@google.com>

In reftable, hashes are correctly formed by design

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t4202-log.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ævar Arnfjörð Bjarmason May 20, 2021, 3:43 p.m. UTC | #1
On Tue, Apr 27 2021, Han-Wen Nienhuys via GitGitGadget wrote:

> From: Han-Wen Nienhuys <hanwen@google.com>
>
> In reftable, hashes are correctly formed by design
>
> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
> ---
>  t/t4202-log.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t4202-log.sh b/t/t4202-log.sh
> index a8c5a00d012d..3f969b01508c 100755
> --- a/t/t4202-log.sh
> +++ b/t/t4202-log.sh
> @@ -1834,7 +1834,7 @@ test_expect_success 'log --graph --no-walk is forbidden' '
>  	test_must_fail git log --graph --no-walk
>  '
>  
> -test_expect_success 'log diagnoses bogus HEAD hash' '
> +test_expect_success REFFILES 'log diagnoses bogus HEAD hash' '
>  	git init empty &&
>  	test_must_fail git -C empty log 2>stderr &&
>  	test_i18ngrep does.not.have.any.commits stderr &&

Okey, they're correctly formed by design, but the first test here is
just checking what happens when we do a "git log" on a repo with no
commits. What does that have to do with reflog's guarantees that we have
a valid-looking SHA in some entry in its database?

Surely we also want to test for the same thing, the ref backend doesn't
change that we have no commits or refs yet, no?
Han-Wen Nienhuys May 31, 2021, 2:21 p.m. UTC | #2
On Thu, May 20, 2021 at 5:44 PM Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
> > -test_expect_success 'log diagnoses bogus HEAD hash' '
> > +test_expect_success REFFILES 'log diagnoses bogus HEAD hash' '
> >       git init empty &&
> >       test_must_fail git -C empty log 2>stderr &&
> >       test_i18ngrep does.not.have.any.commits stderr &&
>
> Okey, they're correctly formed by design, but the first test here is
> just checking what happens when we do a "git log" on a repo with no
> commits. What does that have to do with reflog's guarantees that we have
> a valid-looking SHA in some entry in its database?
>
> Surely we also want to test for the same thing, the ref backend doesn't
> change that we have no commits or refs yet, no?

Done.
diff mbox series

Patch

diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index a8c5a00d012d..3f969b01508c 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -1834,7 +1834,7 @@  test_expect_success 'log --graph --no-walk is forbidden' '
 	test_must_fail git log --graph --no-walk
 '
 
-test_expect_success 'log diagnoses bogus HEAD hash' '
+test_expect_success REFFILES 'log diagnoses bogus HEAD hash' '
 	git init empty &&
 	test_must_fail git -C empty log 2>stderr &&
 	test_i18ngrep does.not.have.any.commits stderr &&