From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: "SZEDER Gábor" <szeder.dev@gmail.com>
Cc: git@vger.kernel.org, Derrick Stolee <derrickstolee@github.com>,
Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 2/6] t3404-rebase-interactive: mark a test with REFFILES prereq
Date: Fri, 30 Sep 2022 18:46:49 +0200 [thread overview]
Message-ID: <220930.86ill4vman.gmgdl@evledraar.gmail.com> (raw)
In-Reply-To: <20220930140948.80367-3-szeder.dev@gmail.com>
On Fri, Sep 30 2022, SZEDER Gábor wrote:
> The test '--update-refs: check failed ref update' added in b3b1a21d1a
> (sequencer: rewrite update-refs as user edits todo list, 2022-07-19)
> directly modifies the contents of a ref file, so mark this test with
> the REFFILES prereq.
>
> Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
> ---
> t/t3404-rebase-interactive.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
> index 688b01e3eb..7f0df58628 100755
> --- a/t/t3404-rebase-interactive.sh
> +++ b/t/t3404-rebase-interactive.sh
> @@ -1964,7 +1964,7 @@ test_expect_success 'respect user edits to update-ref steps' '
> test_cmp_rev HEAD refs/heads/no-conflict-branch
> '
>
> -test_expect_success '--update-refs: check failed ref update' '
> +test_expect_success REFFILES '--update-refs: check failed ref update' '
> git checkout -B update-refs-error no-conflict-branch &&
> git branch -f base HEAD~4 &&
> git branch -f first HEAD~3 &&
We had various tests that depended on .git/refs/* for a good reason, and
some that didn't.
I may be missing something, but in this case this seems to be a "no good
reason" case. I.e. the fix seems to just be:
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 688b01e3eb6..f1c021a7f7b 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -1994,8 +1994,9 @@ test_expect_success '--update-refs: check failed ref update' '
# At this point, the values of first, second, and third are
# recorded in the update-refs file. We will force-update the
# "second" ref, but "git branch -f" will not work because of
- # the lock in the update-refs file.
- git rev-parse third >.git/refs/heads/second &&
+ # the lock in the update-refs file, so we need to use
+ # "update-ref".
+ git update-ref refs/heads/second third &&
test_must_fail git rebase --continue 2>err &&
grep "update_ref failed for ref '\''refs/heads/second'\''" err &&
As the comment notes if you try that with "git branch" you'll get an
error, even with --force, but update-ref works just fine...
next prev parent reply other threads:[~2022-09-30 16:50 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-30 14:09 [PATCH 0/6] rebase --update-refs: smooth out some rough edges SZEDER Gábor
2022-09-30 14:09 ` [PATCH 1/6] t2407-worktree-heads.sh: remove outdated loop SZEDER Gábor
2022-09-30 14:09 ` [PATCH 2/6] t3404-rebase-interactive: mark a test with REFFILES prereq SZEDER Gábor
2022-09-30 16:46 ` Ævar Arnfjörð Bjarmason [this message]
2022-10-05 16:45 ` Junio C Hamano
2022-09-30 14:09 ` [PATCH 3/6] rebase -i: emphasize that 'update-ref' expects a fully-qualified ref SZEDER Gábor
2022-09-30 14:09 ` [PATCH 4/6] sequencer: avoid empty lines after 'update-ref' instructions SZEDER Gábor
2022-09-30 17:18 ` Derrick Stolee
2022-10-05 16:49 ` Junio C Hamano
2022-09-30 14:09 ` [PATCH 5/6] sequencer: duplicate the result of resolve_ref_unsafe() SZEDER Gábor
2022-09-30 16:45 ` Ævar Arnfjörð Bjarmason
2022-09-30 16:51 ` Ævar Arnfjörð Bjarmason
2022-09-30 17:23 ` Derrick Stolee
2022-10-09 17:23 ` SZEDER Gábor
2022-09-30 14:09 ` [PATCH 6/6] sequencer: fail early if invalid ref is given to 'update-ref' instruction SZEDER Gábor
2022-09-30 17:09 ` Ævar Arnfjörð Bjarmason
2022-09-30 17:29 ` [PATCH 0/6] rebase --update-refs: smooth out some rough edges Derrick Stolee
2022-10-01 16:31 ` SZEDER Gábor
2022-10-01 16:53 ` Junio C Hamano
2022-10-05 17:14 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=220930.86ill4vman.gmgdl@evledraar.gmail.com \
--to=avarab@gmail.com \
--cc=derrickstolee@github.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=szeder.dev@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).