git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: Eric Sunshine <sunshine@sunshineco.com>,
	 Aishwarya Narayanan <aishnana.03@gmail.com>,
	 git@vger.kernel.org
Subject: Re: GSoC 2024 [PATCH v2] Fix Git command exit code suppression in test script t2104-update-index-skip-worktree.sh
Date: Tue, 02 Apr 2024 11:41:03 -0700	[thread overview]
Message-ID: <xmqqmsqb4ngg.fsf@gitster.g> (raw)
In-Reply-To: <Zgw_KJ3wO-x2LXI0@tanuki> (Patrick Steinhardt's message of "Tue, 2 Apr 2024 19:23:52 +0200")

Patrick Steinhardt <ps@pks.im> writes:

>> 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 &&


      reply	other threads:[~2024-04-02 18:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-28 18:47 GSoC 2024 [PATCH v2] Fix Git command exit code suppression in test script t2104-update-index-skip-worktree.sh Aishwarya Narayanan
2024-04-02 11:06 ` Patrick Steinhardt
2024-04-02 11:56   ` Aishwarya Narayanan
2024-04-02 17:20   ` Eric Sunshine
2024-04-02 17:23     ` Patrick Steinhardt
2024-04-02 18:41       ` Junio C Hamano [this message]

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=xmqqmsqb4ngg.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=aishnana.03@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=ps@pks.im \
    --cc=sunshine@sunshineco.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).