Thread (86 messages) 86 messages, 5 authors, 2022-07-01

Re: [WIP v2 1/5] t7002: add tests for moving out-of-cone file/directory

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2022-05-27 12:30:51

On Fri, May 27 2022, Shaoxuan Yuan wrote:
+test_expect_failure 'refuse to move out-of-cone directory without --sparse' '
+	git sparse-checkout disable &&
+	git reset --hard &&
+	mkdir folder1 &&
+	touch folder1/file1 &&
We don't usually use "touch file", don't you mean just ">file" here and
below?
+	git add folder1 &&
+	git sparse-checkout init --cone &&
+	git sparse-checkout set sub &&
+
+	test_must_fail git mv folder1 sub 2>stderr &&
+	cat sparse_error_header >expect &&
+	echo folder1/file1 >>expect &&
+	cat sparse_hint >>expect &&
+	test_cmp expect stderr
+'
+
+test_expect_failure 'can move out-of-cone directory with --sparse' '
+	git sparse-checkout disable &&
+	git reset --hard &&
+	mkdir folder1 &&
+	touch folder1/file1 &&
+	git add folder1 &&
+	git sparse-checkout init --cone &&
+	git sparse-checkout set sub &&
+
+	git mv --sparse folder1 sub 1>actual 2>stderr &&
use e.g. "out" and "err" instead of "actual" and "stderr". I.e. when we
test both we use something like that usually.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help