git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] checkout tests: enable test with complex relative path
@ 2013-10-09 14:35 Stefan Beller
  2013-10-09 19:39 ` Jonathan Nieder
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Beller @ 2013-10-09 14:35 UTC (permalink / raw)
  To: git, gitster, jrnieder; +Cc: Stefan Beller

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

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

* Re: [PATCH] checkout tests: enable test with complex relative path
  2013-10-09 14:35 [PATCH] checkout tests: enable test with complex relative path Stefan Beller
@ 2013-10-09 19:39 ` Jonathan Nieder
  2013-10-10  8:04   ` Stefan Beller
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Nieder @ 2013-10-09 19:39 UTC (permalink / raw)
  To: Stefan Beller; +Cc: git, gitster

Stefan Beller wrote:

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

Bisects to v1.5.5-rc0~184^2~3 (setup: sanitize absolute and funny paths
in get_pathspec(), 2008-01-28).  Thanks.

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

* Re: [PATCH] checkout tests: enable test with complex relative path
  2013-10-09 19:39 ` Jonathan Nieder
@ 2013-10-10  8:04   ` Stefan Beller
  2013-10-10 17:54     ` Jonathan Nieder
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Beller @ 2013-10-10  8:04 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: git

On 10/09/2013 09:39 PM, Jonathan Nieder wrote:
> Stefan Beller wrote:
> 
>> 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.)
> 
> Bisects to v1.5.5-rc0~184^2~3 (setup: sanitize absolute and funny paths
> in get_pathspec(), 2008-01-28).  Thanks.
> 

Do you want me to resend a reworded patch, or could you amend that
information to this patch?

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

* Re: [PATCH] checkout tests: enable test with complex relative path
  2013-10-10  8:04   ` Stefan Beller
@ 2013-10-10 17:54     ` Jonathan Nieder
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Nieder @ 2013-10-10 17:54 UTC (permalink / raw)
  To: Stefan Beller; +Cc: git

Stefan Beller wrote:
> On 10/09/2013 09:39 PM, Jonathan Nieder wrote:
>> Stefan Beller wrote:

>>> 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.)
>>
>> Bisects to v1.5.5-rc0~184^2~3 (setup: sanitize absolute and funny paths
>> in get_pathspec(), 2008-01-28).  Thanks.
>
> Do you want me to resend a reworded patch, or could you amend that
> information to this patch?

Added locally, along with a couple of other nits.  Will push out soon,
and then a sanity check on the result would be much appreciated.

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

end of thread, other threads:[~2013-10-10 17:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-09 14:35 [PATCH] checkout tests: enable test with complex relative path Stefan Beller
2013-10-09 19:39 ` Jonathan Nieder
2013-10-10  8:04   ` Stefan Beller
2013-10-10 17:54     ` Jonathan Nieder

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