git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: GSoC 2024 [PATCH v2] Fix Git command exit code suppression in test script t2104-update-index-skip-worktree.sh

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 2, 2024, 18:41 UTC
Message-ID
<xmqqmsqb4ngg.fsf@gitster.g>
In-Reply-To
<Zgw_KJ3wO-x2LXI0@tanuki>
Patrick Steinhardt <ps@pks.im> writes:
Show 7 quoted lines
>> Micro correction: Documentation/CodingGuidelines says this:
>> 
>>     We use tabs to indent, and interpret tabs as taking up
>>     to 8 spaces.
>
> Huh, that's even weirder. The diff changes indentation from four spaces
> to two spaces for me.
Indeed, the original is already flawed.
----- >8 --------- >8 --------- >8 --------- >8 ----
Subject: t2104: style fixes
We use tabs to indent, not two or four spaces.  

These days, even the test fixture preparation should be done inside test_expect_success block.

Address these two style violations in this test.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/t2104-update-index-skip-worktree.sh | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)
diff --git c/t/t2104-update-index-skip-worktree.sh w/t/t2104-update-index-skip-worktree.sh
index 0bab134d71..7ec7f30b44 100755
--- c/t/t2104-update-index-skip-worktree.sh
+++ w/t/t2104-update-index-skip-worktree.sh
@@ -11,27 +11,27 @@ TEST_PASSES_SANITIZE_LEAK=true
 sane_unset GIT_TEST_SPLIT_INDEX
 
 test_set_index_version () {
-    GIT_INDEX_VERSION="$1"
-    export GIT_INDEX_VERSION
+	GIT_INDEX_VERSION="$1"
+	export GIT_INDEX_VERSION
 }
 
 test_set_index_version 3
 
-cat >expect.full <<EOF
-H 1
-H 2
-H sub/1
-H sub/2
-EOF
+test_expect_success 'setup' '
+	cat >expect.full <<-\EOF &&
+	H 1
+	H 2
+	H sub/1
+	H sub/2
+	EOF
 
-cat >expect.skip <<EOF
-S 1
-H 2
-S sub/1
-H sub/2
-EOF
+	cat >expect.skip <<-\EOF &&
+	S 1
+	H 2
+	S sub/1
+	H sub/2
+	EOF
 
-test_expect_success 'setup' '
 	mkdir sub &&
 	touch ./1 ./2 sub/1 sub/2 &&
 	git add 1 2 sub/1 sub/2 &&
Previous: Patrick Steinhardt
Message 6 of 6 in “GSoC 2024 [PATCH v2] Fix Git command exit code suppression in test script t2104-update-index-skip-worktree.sh”
  1. Aishwarya NarayananMar 28, 2024
  2. Patrick SteinhardtApr 2, 2024
  3. Aishwarya NarayananApr 2, 2024
  4. Eric SunshineApr 2, 2024
  5. Patrick SteinhardtApr 2, 2024
  6. Junio C HamanoApr 2, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.