threads / patch / 20497

patch, 2 partst0001-init: fix a file name

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

## tl;dr

3 messages between Aug 9, 2009 and Aug 9, 2009. Diffs are folded; open one to read it.

replies: 2people: 1as markdown or json

Johannes Sixt· Aug 9, 2009, 15:38 UTC · lore

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

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
  t/t0001-init.sh |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to t/t0001-init.sh +1 −1
diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index 49caa29..07e011d 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
@@ -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
  	)
-- 
1.6.4.1186.g1d9a
Johannes Sixt· Aug 9, 2009, 15:39 UTC · re: Johannes Sixt · lore

[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.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
  t/t0001-init.sh |    8 ++++++++
  1 files changed, 8 insertions(+), 0 deletions(-)
Show changes to t/t0001-init.sh +8 −0
diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index 07e011d..e53b234 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
@@ -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 &&
-- 
1.6.4.1186.g1d9a
Johannes Sixt· Aug 9, 2009, 16:02 UTC · re: Johannes Sixt · lore

[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.

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(-)
Show changes to t/t0001-init.sh +6 −0
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

	

← back to recent threads