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

[PATCH v2 2/2] t0001-init: split the existence test from the permission test

From
Johannes Sixt <j6t@kdbg.org>
Date
Aug 9, 2009, 16:02 UTC
Message-ID
<4A7EF32F.6080408@kdbg.org>
In-Reply-To
<4A7EEDA7.30301@kdbg.org>

The test for correct permissions after init created a deep directory must be guarded by POSIXPERM. But testing that the deep dirctory exists is good even on platforms that do not provide the POSIXPERM prerequiste.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
  Sorry, the first version was the result of mindless copying. This version
  removes the sub-shell (parentheses).
  -- Hannes
  t/t0001-init.sh |    6 ++++++
  1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index 07e011d..5386504 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
@@ -244,6 +244,12 @@ test_expect_success 'init recreates a new bare directory' '

  test_expect_success 'init creates a new deep directory' '
  	rm -fr newdir &&
+	git init newdir/a/b/c &&
+	test -d newdir/a/b/c/.git/refs
+'
+
+test_expect_success POSIXPERM 'init creates a new deep directory (umask vs. shared)' '
+	rm -fr newdir &&
  	(
  		# Leading directories should honor umask while
  		# the repository itself should follow "shared"
-- 
1.6.4.1186.g1d9a

	
Previous: Johannes Sixt
Message 3 of 3 in “t0001-init: fix a file name”
  1. 1/2 t0001-init: fix a file nameJohannes Sixt, Aug 9, 2009
  2. 2/2 t0001-init: split the existence test from the permission testJohannes Sixt, Aug 9, 2009
  3. 2/2 t0001-init: split the existence test from the permission testJohannes Sixt, Aug 9, 2009

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.