All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Sixt <j6t@kdbg.org>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>
Subject: [PATCH ab/fsck-unexpected-type] t1450-fsck: exec-bit is not needed to make loose object writable
Date: Thu, 13 Jan 2022 21:28:45 +0100	[thread overview]
Message-ID: <529d99f3-13c8-ffc1-dd4c-3fc70330262a@kdbg.org> (raw)

A test case wants to append stuff to a loose object file to ensure
that this kind of corruption is detected. To make a read-only loose
object file writable with chmod, it is not necessary to also make
it executable. Replace the bitmask 755 with the instruction +w to
request only the write bit and to also heed the umask. And get rid
of a POSIXPERM prerequisite, which is unnecessary for the test.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 I happened to notice this by chance when I built on Windows today.

 t/t1450-fsck.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh
index 6337236fd8..de50c0ea01 100755
--- a/t/t1450-fsck.sh
+++ b/t/t1450-fsck.sh
@@ -94,13 +94,13 @@ test_expect_success 'object with hash and type mismatch' '
 	)
 '
 
-test_expect_success POSIXPERM 'zlib corrupt loose object output ' '
+test_expect_success 'zlib corrupt loose object output ' '
 	git init --bare corrupt-loose-output &&
 	(
 		cd corrupt-loose-output &&
 		oid=$(git hash-object -w --stdin --literally </dev/null) &&
 		oidf=objects/$(test_oid_to_path "$oid") &&
-		chmod 755 $oidf &&
+		chmod +w $oidf &&
 		echo extra garbage >>$oidf &&
 
 		cat >expect.error <<-EOF &&
-- 
2.34.1.141.g867d0e9267


             reply	other threads:[~2022-01-13 20:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-13 20:28 Johannes Sixt [this message]
2022-01-13 23:04 ` [PATCH ab/fsck-unexpected-type] t1450-fsck: exec-bit is not needed to make loose object writable 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

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

  git send-email \
    --in-reply-to=529d99f3-13c8-ffc1-dd4c-3fc70330262a@kdbg.org \
    --to=j6t@kdbg.org \
    --cc=avarab@gmail.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.