git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "SZEDER Gábor" <szeder.dev@gmail.com>
To: git@vger.kernel.org
Cc: "Derrick Stolee" <derrickstolee@github.com>,
	"Junio C Hamano" <gitster@pobox.com>,
	"SZEDER Gábor" <szeder.dev@gmail.com>
Subject: [PATCH 1/6] t2407-worktree-heads.sh: remove outdated loop
Date: Fri, 30 Sep 2022 16:09:43 +0200	[thread overview]
Message-ID: <20220930140948.80367-2-szeder.dev@gmail.com> (raw)
In-Reply-To: <20220930140948.80367-1-szeder.dev@gmail.com>

The test 'refuse to overwrite during rebase with --update-refs'
initially [1] used two branches 'fake-3' and 'fake-4', and to run the
same git operation and check on both it used a 'for i in 3 4' loop.
This test was then soon updated [2] to operate only on a single
branch.  This change made that loop unnecessary, but it forgot to
remove it.

(For future work, note the misleading error message in this test: it
says "cannot force update the branch <branch> checked out at
<worktree>", but the branch in question is not, in fact, checked out
in the named worktree (it's not checked out anywhere actually!); it
can't be updated because it's kind-of "locked" by an 'update-ref'
instruction of the ongoing rebase operation.)

[1] aa7f2fd150 (branch: consider refs under 'update-refs', 2022-07-19)
[2] 89fc0b53fd (rebase: update refs from 'update-ref' commands,
                2022-07-19)

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
---
 t/t2407-worktree-heads.sh | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/t/t2407-worktree-heads.sh b/t/t2407-worktree-heads.sh
index 019a40df2c..126f0d4956 100755
--- a/t/t2407-worktree-heads.sh
+++ b/t/t2407-worktree-heads.sh
@@ -87,12 +87,8 @@ test_expect_success !SANITIZE_LEAK 'refuse to overwrite: worktree in rebase with
 	git branch -f can-be-updated wt-3 &&
 	test_must_fail git -C wt-3 rebase --update-refs conflict-3 &&
 
-	for i in 3 4
-	do
-		test_must_fail git branch -f can-be-updated HEAD 2>err &&
-		grep "cannot force update the branch '\''can-be-updated'\'' checked out at.*wt-3" err ||
-			return 1
-	done
+	test_must_fail git branch -f can-be-updated HEAD 2>err &&
+	grep "cannot force update the branch '\''can-be-updated'\'' checked out at.*wt-3" err
 '
 
 test_expect_success !SANITIZE_LEAK 'refuse to fetch over ref: checked out' '
-- 
2.38.0.rc2.542.g9b62912f7f


  reply	other threads:[~2022-09-30 14:12 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 ` SZEDER Gábor [this message]
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
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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220930140948.80367-2-szeder.dev@gmail.com \
    --to=szeder.dev@gmail.com \
    --cc=derrickstolee@github.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).