diff mbox series

[v2,19/21] t7003: check reflog existence only for REFFILES

Message ID 24dcf05d8fa6172d04ca047a860ad5019aad17b7.1619519903.git.gitgitgadget@gmail.com (mailing list archive)
State New
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>

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t7003-filter-branch.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

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

> From: Han-Wen Nienhuys <hanwen@google.com>
>
> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
> ---
>  t/t7003-filter-branch.sh | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
> index cf30055c88dd..e18a21895238 100755
> --- a/t/t7003-filter-branch.sh
> +++ b/t/t7003-filter-branch.sh
> @@ -396,7 +396,10 @@ test_expect_success '--prune-empty is able to prune entire branch' '
>  	git branch prune-entire B &&
>  	git filter-branch -f --prune-empty --index-filter "git update-index --remove A.t B.t" prune-entire &&
>  	test_must_fail git rev-parse refs/heads/prune-entire &&
> -	test_must_fail git reflog exists refs/heads/prune-entire
> +	if test_have_prereq REFFILES
> +	then
> +		test_must_fail git reflog exists refs/heads/prune-entire
> +	fi
>  '
>  
>  test_expect_success '--remap-to-ancestor with filename filters' '

Ditto chicken and egg, but isn't this conflating "we always write logs"
v.s. reftable just behaving differently, i.e. shouldn't this be
positively asserting that we have the log *for that branch* still after
its deletion?
Han-Wen Nienhuys May 31, 2021, 2:27 p.m. UTC | #2
On Thu, May 20, 2021 at 5:42 PM Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
> > -     test_must_fail git reflog exists refs/heads/prune-entire
> > +     if test_have_prereq REFFILES
> > +     then
> > +             test_must_fail git reflog exists refs/heads/prune-entire
> > +     fi
> >  '
> >
> >  test_expect_success '--remap-to-ancestor with filename filters' '
>
> Ditto chicken and egg, but isn't this conflating "we always write logs"
> v.s. reftable just behaving differently, i.e. shouldn't this be
> positively asserting that we have the log *for that branch* still after
> its deletion?

That is a great topic to discuss on the reftable series.
diff mbox series

Patch

diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
index cf30055c88dd..e18a21895238 100755
--- a/t/t7003-filter-branch.sh
+++ b/t/t7003-filter-branch.sh
@@ -396,7 +396,10 @@  test_expect_success '--prune-empty is able to prune entire branch' '
 	git branch prune-entire B &&
 	git filter-branch -f --prune-empty --index-filter "git update-index --remove A.t B.t" prune-entire &&
 	test_must_fail git rev-parse refs/heads/prune-entire &&
-	test_must_fail git reflog exists refs/heads/prune-entire
+	if test_have_prereq REFFILES
+	then
+		test_must_fail git reflog exists refs/heads/prune-entire
+	fi
 '
 
 test_expect_success '--remap-to-ancestor with filename filters' '