From: Christian Couder <christian.couder@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
"Michael Haggerty" <mhagger@alum.mit.edu>,
"Nguyen Thai Ngoc Duy" <pclouds@gmail.com>,
"Ramsay Jones" <ramsay@ramsayjones.plus.com>,
"Christian Couder" <chriscool@tuxfamily.org>
Subject: [PATCH v2 3/3] t1700: make sure split-index respects core.sharedrepository
Date: Fri, 23 Jun 2017 17:16:40 +0200 [thread overview]
Message-ID: <20170623151640.24082-3-chriscool@tuxfamily.org> (raw)
In-Reply-To: <20170623151640.24082-1-chriscool@tuxfamily.org>
Add a few tests to check that both the split-index file and the
shared-index file are created using the right permissions when
core.sharedrepository is set.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
t/t1700-split-index.sh | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh
index af3ec0da5a..2c5be732e4 100755
--- a/t/t1700-split-index.sh
+++ b/t/t1700-split-index.sh
@@ -370,4 +370,21 @@ test_expect_success 'check splitIndex.sharedIndexExpire set to "never" and "now"
test $(ls .git/sharedindex.* | wc -l) -le 2
'
+while read -r mode modebits filename; do
+ test_expect_success POSIXPERM "split index respects core.sharedrepository $mode" '
+ git config core.sharedrepository "$mode" &&
+ : >"$filename" &&
+ git update-index --add "$filename" &&
+ echo "$modebits" >expect &&
+ test_modebits .git/index >actual &&
+ test_cmp expect actual &&
+ newest_shared_index=$(ls -t .git/sharedindex.* | head -1) &&
+ test_modebits "$newest_shared_index" >actual &&
+ test_cmp expect actual
+ '
+done <<\EOF
+0666 -rw-rw-rw- seventeen
+0642 -rw-r---w- eightteen
+EOF
+
test_done
--
2.13.1.519.g0a0746bea4
next prev parent reply other threads:[~2017-06-23 15:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-23 15:16 [PATCH v2 1/3] read-cache: use shared perms when writing shared index Christian Couder
2017-06-23 15:16 ` [PATCH v2 2/3] t1301: move modebits() to test-lib-functions.sh Christian Couder
2017-06-23 15:16 ` Christian Couder [this message]
2017-06-23 22:20 ` [PATCH v2 3/3] t1700: make sure split-index respects core.sharedrepository Junio C Hamano
2017-06-25 4:39 ` Christian Couder
2017-06-23 21:55 ` [PATCH v2 1/3] read-cache: use shared perms when writing shared index Junio C Hamano
2017-06-23 22:02 ` Junio C Hamano
2017-06-25 4:42 ` Christian Couder
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=20170623151640.24082-3-chriscool@tuxfamily.org \
--to=christian.couder@gmail.com \
--cc=avarab@gmail.com \
--cc=chriscool@tuxfamily.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=mhagger@alum.mit.edu \
--cc=pclouds@gmail.com \
--cc=ramsay@ramsayjones.plus.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 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 NNTP newsgroup(s).