git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: [PATCH 1/2] t1301: set umask in reflog sharedrepository=group test
Date: Mon, 5 Jan 2015 22:49:43 -0500	[thread overview]
Message-ID: <20150106034942.GA20087@peff.net> (raw)
In-Reply-To: <20150106034702.GA11503@peff.net>

The t1301 script sets the umask globally before many of the
tests. Most of the tests that care about the umask then set
it explicitly at the start of the test. However, one test
does not, and relies on the 077 umask setting from earlier
tests. This is fragile and can break if another test is
added in between. Let's be more explicit.

Signed-off-by: Jeff King <peff@peff.net>
---
I suspect the world would be a better place if t1301 did all of its
umask setting in subshells, as it may also affect things like writing
out the test results. But nobody has complained, so I'm not inclined to
spend a lot of time futzing with it.

This is enough to protect the test I'm about to add in the next patch,
so it's not worse than the status quo.

 t/t1301-shared-repo.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/t/t1301-shared-repo.sh b/t/t1301-shared-repo.sh
index de42d21..86ed901 100755
--- a/t/t1301-shared-repo.sh
+++ b/t/t1301-shared-repo.sh
@@ -112,6 +112,7 @@ do
 done
 
 test_expect_success POSIXPERM 'git reflog expire honors core.sharedRepository' '
+	umask 077 &&
 	git config core.sharedRepository group &&
 	git reflog expire --all &&
 	actual="$(ls -l .git/logs/refs/heads/master)" &&
-- 
2.2.1.425.g441bb3c

  reply	other threads:[~2015-01-06  3:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-05 19:07 git 2.2.x: Unexpected, overstrict file permissions after "git update-server-info" Paul Sokolovsky
2015-01-05 22:23 ` Torsten Bögershausen
2015-01-06  3:47 ` Jeff King
2015-01-06  3:49   ` Jeff King [this message]
2015-01-06  3:50   ` [PATCH 2/2] update-server-info: create info/* with mode 0666 Jeff King
2015-01-06 18:47     ` Junio C Hamano
2015-01-06 19:39       ` Jeff King
2015-01-06 21:43         ` Junio C Hamano
2015-01-06 21:47           ` Jeff King
2015-01-06 10:08   ` git 2.2.x: Unexpected, overstrict file permissions after "git update-server-info" Junio C Hamano
2015-01-06 12:43     ` Paul Sokolovsky
2015-01-06 18:44     ` Junio C Hamano
2015-01-06 19:37     ` Jeff King
2015-01-06 12:12   ` Paul Sokolovsky

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=20150106034942.GA20087@peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=paul.sokolovsky@linaro.org \
    /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).