From: David Symonds <dsymonds@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
David Symonds <dsymonds@gmail.com>
Subject: [PATCH] git-checkout: Handle relative paths containing "..".
Date: Thu, 8 Nov 2007 13:33:12 +1100 [thread overview]
Message-ID: <1194489192-20021-1-git-send-email-dsymonds@gmail.com> (raw)
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
next reply other threads:[~2007-11-08 2:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-08 2:33 David Symonds [this message]
2007-11-08 8:30 ` [PATCH] git-checkout: Handle relative paths containing ".." Junio C Hamano
2007-11-08 13:10 ` David Symonds
2007-11-08 14:25 ` Johannes Schindelin
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1194489192-20021-1-git-send-email-dsymonds@gmail.com \
--to=dsymonds@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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.
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).