Skip to contentSkip to conversation

t0001-init: fix a file name

PATCH New Johannes Sixt 1 participant 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 t0001-init: fix a file name

Without this change, grep fails because it does not find the file instead of because it does not find the text in the file.

---
 t/t0001-init.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
t/t0001-init.sh +1 -1
index 49caa29..07e011d 100755
@@ -251,7 +251,7 @@ test_expect_success 'init creates a new deep directory' '
 		git init --bare --shared=0660 newdir/a/b/c &&
 		test -d newdir/a/b/c/refs &&
 		ls -ld newdir/a newdir/a/b > lsab.out &&
-		! grep -v "^drwxrw[sx]r-x" ls.out &&
+		! grep -v "^drwxrw[sx]r-x" lsab.out &&
 		ls -ld newdir/a/b/c > lsc.out &&
 		! grep -v "^drwxrw[sx]---" lsc.out
 	)
Signature · 1 line
1.6.4.1186.g1d9a
#1 lore raw

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

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.

---
 t/t0001-init.sh |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
t/t0001-init.sh +8 -0
index 07e011d..e53b234 100755
@@ -245,6 +245,14 @@ 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"
 		umask 002 &&
Signature · 1 line
1.6.4.1186.g1d9a
#2 lore raw

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

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.

---
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(-)
t/t0001-init.sh +6 -0
index 07e011d..5386504 100755
@@ -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"
Signature · 1 line
1.6.4.1186.g1d9a