Thread (24 messages) flat view 24 messages, 4 authors, 2021-11-10

Re: [PATCH v3 2/2] receive-pack: Protect current branch for bare repository worktree

From: Johannes Schindelin <hidden>
Date: 2021-11-09 15:37:47

Possibly related (same subject, not in this thread)

Hi,

On Mon, 8 Nov 2021, Junio C Hamano wrote:
Anders Kaseorg [off-list ref] writes:
quoted
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index 4ef4ecbe71..52a4686afe 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -1763,20 +1763,25 @@ test_expect_success 'updateInstead with push-to-checkout hook' '

 test_expect_success 'denyCurrentBranch and worktrees' '
 	git worktree add new-wt &&
+	git clone --bare . bare.git &&
+	git -C bare.git worktree add bare-wt &&
We create a bare.git bare repository with a bare-wt worktree that
has a working tree.  bare-wt branch must be protected now.

[...]
quoted
 '

 test_expect_success 'refuse fetch to current branch of worktree' '
 	test_commit -C cloned second &&
 	test_must_fail git fetch cloned HEAD:new-wt &&
-	git clone --bare . bare.git &&
-	git -C bare.git worktree add bare-wt &&
It is a bit sad that these two tests are so inter-dependent.
Depending on an earlier failure of other tests, this may fail in an
unexpected way.
Indeed. Maybe we should keep the latter as-is, and add this to the former?

	test_when_finished "rm -rf bare.git bare-wt" &&

Ciao,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help