git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Stefan Beller <stefanbeller@googlemail.com>
To: git@vger.kernel.org, gitster@pobox.com, jrnieder@gmail.com
Cc: Stefan Beller <stefanbeller@googlemail.com>
Subject: [PATCH] checkout tests: enable test with complex relative path
Date: Wed,  9 Oct 2013 16:35:11 +0200	[thread overview]
Message-ID: <1381329311-5920-1-git-send-email-stefanbeller@googlemail.com> (raw)

This test was put in, but commented out in fed1b5ca (2007-11-09,
git-checkout: Test for relative path use.)
It's been a while since 2007 and the intended test case works now.
(I could not find the enabling commit in ls-files however.)

The code in question however did not change into the sub directory,
so we still need to add a 'cd'. Also a test for the file content has been
added. This is already part of the other tests for checkout.

Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
---
 t/t2008-checkout-subdir.sh | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/t/t2008-checkout-subdir.sh b/t/t2008-checkout-subdir.sh
index 3e098ab..399655f 100755
--- a/t/t2008-checkout-subdir.sh
+++ b/t/t2008-checkout-subdir.sh
@@ -58,13 +58,14 @@ test_expect_success 'checkout with simple prefix' '
 
 '
 
-# This is not expected to work as ls-files was not designed
-# to deal with such.  Enable it when ls-files is updated.
-: test_expect_success 'checkout with complex relative path' '
-
-	rm file1 &&
-	git checkout HEAD -- ../dir1/../dir1/file1 && test -f ./file1
-
+test_expect_success 'checkout with complex relative path' '
+	(
+		cd dir1 &&
+		rm file1 &&
+		git checkout HEAD -- ../dir1/../dir1/file1 &&
+		test -f file1 &&
+		test "hello" = "$(cat file1)"
+	)
 '
 
 test_expect_success 'relative path outside tree should fail' \
-- 
1.8.4.1.471.g53f64e4.dirty

             reply	other threads:[~2013-10-09 14:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-09 14:35 Stefan Beller [this message]
2013-10-09 19:39 ` [PATCH] checkout tests: enable test with complex relative path Jonathan Nieder
2013-10-10  8:04   ` Stefan Beller
2013-10-10 17:54     ` Jonathan Nieder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1381329311-5920-1-git-send-email-stefanbeller@googlemail.com \
    --to=stefanbeller@googlemail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).