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

[PATCH 1/2] t1301: set umask in reflog sharedrepository=group test

From
Jeff King <peff@peff.net>
Date
Jan 6, 2015, 03:49 UTC
Message-ID
<20150106034942.GA20087@peff.net>
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
Previous: Jeff KingNext: Jeff King
Message 4 of 14 in “git 2.2.x: Unexpected, overstrict file permissions after "git update-server-info"”
  1. Paul SokolovskyJan 5, 2015
  2. Torsten BögershausenJan 5, 2015
  3. Jeff KingJan 6, 2015
  4. 1/2 t1301: set umask in reflog sharedrepository=group testJeff King, Jan 6, 2015
  5. 2/2 update-server-info: create info/* with mode 0666Jeff King, Jan 6, 2015
  6. Junio C HamanoJan 6, 2015
  7. Jeff KingJan 6, 2015
  8. Junio C HamanoJan 6, 2015
  9. Jeff KingJan 6, 2015
  10. Junio C HamanoJan 6, 2015
  11. Paul SokolovskyJan 6, 2015
  12. Junio C HamanoJan 6, 2015
  13. Jeff KingJan 6, 2015
  14. Paul SokolovskyJan 6, 2015

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.