{"thread":{"id":"10718","subject":"[REPLACEMENT PATCH] git-checkout: Add a test case for relative paths use.","startedAt":"2007-11-08T05:43:28Z","lastAt":"2007-11-08T13:12:14Z","messageCount":3,"participants":["David Symonds","Andreas Ericsson"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"58798","messageId":"11945006082887-git-send-email-dsymonds@gmail.com","threadId":"10718","inReplyTo":null,"subject":"[REPLACEMENT PATCH] git-checkout: Add a test case for relative paths use.","fromName":"David Symonds","fromEmail":"dsymonds@gmail.com","sentAt":"2007-11-08T05:43:28Z","receivedAt":"2007-11-08T05:43:28Z","isPatch":true,"sender":{"key":"dsymonds@gmail.com","avatar":"https://gravatar.com/avatar/b22f5051cbfc11836e36cf7a690e6cde4e225d835e13295ff98d15c7a9ee3c0f?d=mp&s=160"},"body":"Signed-off-by: David Symonds <dsymonds@gmail.com>\n---\n\tThese test cases also expose a bug in git-ls-files, where:\n\t\tgit-ls-files t/../\n\t(with or without --full-name) returns no files.\n\n t/t2008-checkout-subdir.sh |   47 ++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 47 insertions(+), 0 deletions(-)\n create mode 100755 t/t2008-checkout-subdir.sh\n\ndiff --git a/t/t2008-checkout-subdir.sh b/t/t2008-checkout-subdir.sh\nnew file mode 100755\nindex 0000000..45833f3\n--- /dev/null\n+++ b/t/t2008-checkout-subdir.sh\n@@ -0,0 +1,47 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2007 David Symonds\n+\n+test_description='git checkout from subdirectories'\n+\n+. ./test-lib.sh\n+\n+test_expect_success setup '\n+\n+\techo base > file0 &&\n+\tgit add file0 &&\n+\tmkdir dir1 &&\n+\techo hello > dir1/file1 &&\n+\tgit add dir1/file1 &&\n+\ttest_tick &&\n+\tmkdir dir2 &&\n+\techo bonjour > dir2/file2 &&\n+\tgit add dir2/file2 &&\n+\tgit commit -m \"populate tree\"\n+\n+'\n+\n+test_expect_success 'remove and restore with relative path' '\n+\n+\tcd dir1 &&\n+\trm ../file0 &&\n+\tgit checkout HEAD -- ../file0 && test -f ../file0 &&\n+\trm ../dir2/file2 &&\n+\tgit checkout HEAD -- ../dir2/file2 && test -f ../dir2/file2 &&\n+\trm ../file0 ./file1 &&\n+\tgit checkout HEAD -- .. && test -f ../file0 && test -f ./file1 &&\n+\trm file1 &&\n+\tgit checkout HEAD -- ../dir1/../dir1/file1 && test -f ./file1\n+\n+'\n+\n+test_expect_failure 'checkout with relative path outside tree should fail (1)' \\\n+\t'git checkout HEAD - ../file0'\n+\n+test_expect_failure 'checkout with relative path outside tree should fail (2)' \\\n+\t'cd dir1 && git checkout HEAD - ./file0'\n+\n+test_expect_failure 'checkout with relative path outside tree should fail (2)' \\\n+\t'cd dir1 && git checkout HEAD - ../../file0'\n+\n+test_done\n-- \n1.5.3.1\n"},{"id":"58840","messageId":"4732D5A9.5040504@op5.se","threadId":"10718","inReplyTo":"11945006082887-git-send-email-dsymonds@gmail.com","subject":"Re: [REPLACEMENT PATCH] git-checkout: Add a test case for relative paths use.","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2007-11-08T09:23:53Z","receivedAt":"2007-11-08T09:23:53Z","isPatch":true,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"David Symonds wrote:\n> +'\n> +\n> +test_expect_failure 'checkout with relative path outside tree should fail (1)' \\\n> +\t'git checkout HEAD - ../file0'\n> +\n> +test_expect_failure 'checkout with relative path outside tree should fail (2)' \\\n> +\t'cd dir1 && git checkout HEAD - ./file0'\n> +\n> +test_expect_failure 'checkout with relative path outside tree should fail (2)' \\\n> +\t'cd dir1 && git checkout HEAD - ../../file0'\n\n\nSingle-dashes on all of these?\n\nLooks good otherwise.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"58878","messageId":"ee77f5c20711080512h2304d2b1y5d3040e2be375197@mail.gmail.com","threadId":"10718","inReplyTo":"4732D5A9.5040504@op5.se","subject":"Re: [REPLACEMENT PATCH] git-checkout: Add a test case for relative paths use.","fromName":"David Symonds","fromEmail":"dsymonds@gmail.com","sentAt":"2007-11-08T13:12:14Z","receivedAt":"2007-11-08T13:12:14Z","isPatch":true,"sender":{"key":"dsymonds@gmail.com","avatar":"https://gravatar.com/avatar/b22f5051cbfc11836e36cf7a690e6cde4e225d835e13295ff98d15c7a9ee3c0f?d=mp&s=160"},"body":"On Nov 8, 2007 8:23 PM, Andreas Ericsson <ae@op5.se> wrote:\n>\n> Single-dashes on all of these?\n\nDamn. I wonder how it passed? I'll resend shortly.\n\n\nDave.\n"}]}