git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] grep: simple test for operation in a bare repository
@ 2010-02-03 18:16 René Scharfe
  2010-02-03 23:50 ` René Scharfe
  0 siblings, 1 reply; 7+ messages in thread
From: René Scharfe @ 2010-02-03 18:16 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Junio C Hamano

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
---
 t/t7002-grep.sh |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/t/t7002-grep.sh b/t/t7002-grep.sh
index bf4d4dc..8cf958d 100755
--- a/t/t7002-grep.sh
+++ b/t/t7002-grep.sh
@@ -45,6 +45,23 @@ test_expect_success 'grep should not segfault with a bad input' '
 	test_must_fail git grep "("
 '
 
+bare_repo=.git/bare_test_repo
+test_expect_success 'setup bare repo' '
+	git clone --bare . $bare_repo
+'
+
+test_expect_success "grep HEAD (t-1), bare repo" '(
+	cd $bare_repo &&
+	echo "HEAD:t/t:1:test" >expected &&
+	git grep -n -e test HEAD >actual &&
+	diff expected actual
+)'
+
+test_expect_success "grep (t-1), bare repo, must fail" '(
+	cd $bare_repo &&
+	test_must_fail git grep -n -e test
+)'
+
 for H in HEAD ''
 do
 	case "$H" in
-- 
1.7.0.rc1

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

end of thread, other threads:[~2010-02-06 18:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-03 18:16 [PATCH] grep: simple test for operation in a bare repository René Scharfe
2010-02-03 23:50 ` René Scharfe
2010-02-05  0:24   ` René Scharfe
2010-02-05  2:40     ` Nguyen Thai Ngoc Duy
2010-02-06  9:35       ` René Scharfe
2010-02-06 18:47         ` Junio C Hamano
2010-02-05  6:50     ` 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).