git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-checkout: Handle relative paths containing "..".
@ 2007-11-08  2:33 David Symonds
  2007-11-08  8:30 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: David Symonds @ 2007-11-08  2:33 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Johannes Schindelin, David Symonds

Based on gitte's idea.

Signed-off-by: David Symonds <dsymonds@gmail.com>
---
 git-checkout.sh |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/git-checkout.sh b/git-checkout.sh
index 8993920..b2c50aa 100755
--- a/git-checkout.sh
+++ b/git-checkout.sh
@@ -134,9 +134,10 @@ Did you intend to checkout '$@' which can not be resolved as commit?"
 	fi
 
 	# Make sure the request is about existing paths.
-	git ls-files --error-unmatch -- "$@" >/dev/null || exit
-	git ls-files -- "$@" |
-	git checkout-index -f -u --stdin
+	git ls-files --full-name --error-unmatch -- "$@" >/dev/null || exit
+	git ls-files --full-name -- "$@" |
+		(cd "$(git-rev-parse --show-cdup)" &&
+		 git checkout-index -f -u --stdin)
 
         # Run a post-checkout hook -- the HEAD does not change so the
         # current HEAD is passed in for both args
-- 
1.5.3.5.1529.g69a1-dirty

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

end of thread, other threads:[~2007-11-08 14:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-08  2:33 [PATCH] git-checkout: Handle relative paths containing ".." David Symonds
2007-11-08  8:30 ` Junio C Hamano
2007-11-08 13:10   ` David Symonds
2007-11-08 14:25     ` Johannes Schindelin

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