git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] Move 'rev-parse --git-dir' test to t1500
@ 2009-02-14 16:16 SZEDER Gábor
  2009-02-14 16:16 ` [PATCH 2/2] t1500: more 'git rev-parse --git-dir' tests SZEDER Gábor
  0 siblings, 1 reply; 3+ messages in thread
From: SZEDER Gábor @ 2009-02-14 16:16 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, SZEDER Gábor

Commit 72183cb2 (Fix gitdir detection when in subdir of
gitdir, 2009-01-16) added a test to 't1501-worktree' to check the
behaviour of 'git rev-parse --git-dir' in a special case.  However,
t1501 is about testing separate work tree setups, and not about basic
'rev-parse' functionality, which is tested in t1500-rev-parse.
Therefore, this patch moves that test to t1500.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
 t/t1500-rev-parse.sh |   11 +++++++++--
 t/t1501-worktree.sh  |    7 -------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/t/t1500-rev-parse.sh b/t/t1500-rev-parse.sh
index 85da4ca..186792e 100755
--- a/t/t1500-rev-parse.sh
+++ b/t/t1500-rev-parse.sh
@@ -26,16 +26,23 @@ test_rev_parse() {
 	"test '$1' = \"\$(git rev-parse --show-prefix)\""
 	shift
 	[ $# -eq 0 ] && return
+
+	test_expect_success "$name: git-dir" \
+	"test '$1' = \"\$(git rev-parse --git-dir)\""
+	shift
+	[ $# -eq 0 ] && return
 }
 
-# label is-bare is-inside-git is-inside-work prefix
+# label is-bare is-inside-git is-inside-work prefix git-dir
+
+ROOT=$(pwd)
 
 test_rev_parse toplevel false false true ''
 
 cd .git || exit 1
 test_rev_parse .git/ false true false ''
 cd objects || exit 1
-test_rev_parse .git/objects/ false true false ''
+test_rev_parse .git/objects/ false true false '' "$ROOT/.git"
 cd ../.. || exit 1
 
 mkdir -p sub/dir || exit 1
diff --git a/t/t1501-worktree.sh b/t/t1501-worktree.sh
index 27dc6c5..f6a6f83 100755
--- a/t/t1501-worktree.sh
+++ b/t/t1501-worktree.sh
@@ -92,13 +92,6 @@ cd sub/dir || exit 1
 test_rev_parse 'in repo.git/sub/dir' false true true sub/dir/
 cd ../../../.. || exit 1
 
-test_expect_success 'detecting gitdir when cwd is in a subdir of gitdir' '
-	(expected=$(pwd)/repo.git &&
-	 cd repo.git/refs &&
-	 unset GIT_DIR &&
-	 test "$expected" = "$(git rev-parse --git-dir)")
-'
-
 test_expect_success 'repo finds its work tree' '
 	(cd repo.git &&
 	 : > work/sub/dir/untracked &&
-- 
1.6.2.rc0.81.g79856

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] t1500: more 'git rev-parse --git-dir' tests
  2009-02-14 16:16 [PATCH 1/2] Move 'rev-parse --git-dir' test to t1500 SZEDER Gábor
@ 2009-02-14 16:16 ` SZEDER Gábor
  2009-02-15 19:33   ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: SZEDER Gábor @ 2009-02-14 16:16 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, SZEDER Gábor

Extend t1500 with tests of 'git rev-parse --git-dir' when invoked from
other directories of the repository or the work tree.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---

  In a separate commit to clearly indicate which test was moved and
  which ones are new.

 t/t1500-rev-parse.sh |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/t/t1500-rev-parse.sh b/t/t1500-rev-parse.sh
index 186792e..48ee077 100755
--- a/t/t1500-rev-parse.sh
+++ b/t/t1500-rev-parse.sh
@@ -37,17 +37,17 @@ test_rev_parse() {
 
 ROOT=$(pwd)
 
-test_rev_parse toplevel false false true ''
+test_rev_parse toplevel false false true '' .git
 
 cd .git || exit 1
-test_rev_parse .git/ false true false ''
+test_rev_parse .git/ false true false '' .
 cd objects || exit 1
 test_rev_parse .git/objects/ false true false '' "$ROOT/.git"
 cd ../.. || exit 1
 
 mkdir -p sub/dir || exit 1
 cd sub/dir || exit 1
-test_rev_parse subdirectory false false true sub/dir/
+test_rev_parse subdirectory false false true sub/dir/ "$ROOT/.git"
 cd ../.. || exit 1
 
 git config core.bare true
-- 
1.6.2.rc0.81.g79856

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2] t1500: more 'git rev-parse --git-dir' tests
  2009-02-14 16:16 ` [PATCH 2/2] t1500: more 'git rev-parse --git-dir' tests SZEDER Gábor
@ 2009-02-15 19:33   ` Junio C Hamano
  0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2009-02-15 19:33 UTC (permalink / raw)
  To: SZEDER Gábor; +Cc: git

Thanks, queued.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-02-15 19:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-14 16:16 [PATCH 1/2] Move 'rev-parse --git-dir' test to t1500 SZEDER Gábor
2009-02-14 16:16 ` [PATCH 2/2] t1500: more 'git rev-parse --git-dir' tests SZEDER Gábor
2009-02-15 19:33   ` Junio C Hamano

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