git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] git-checkout: Support relative paths containing "..".

From
David Symonds <dsymonds@gmail.com>
Date
Nov 9, 2007, 00:36 UTC
Message-ID
<11945685673280-git-send-email-dsymonds@gmail.com>
Signed-off-by: David Symonds <dsymonds@gmail.com>
---
 git-checkout.sh |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/git-checkout.sh b/git-checkout.sh
index c00cedd..aa724ac 100755
--- a/git-checkout.sh
+++ b/git-checkout.sh
@@ -133,9 +133,9 @@ 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_to_toplevel && 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.1
Next: David Symonds
Message 1 of 15 in “git-checkout: Support relative paths containing "..".”
  1. git-checkout: Support relative paths containing "..".David Symonds, Nov 9, 2007
  2. git-checkout: Test for relative path use.David Symonds, Nov 9, 2007
  3. Junio C HamanoNov 9, 2007
  4. David SymondsNov 9, 2007
  5. Junio C HamanoNov 9, 2007
  6. David SymondsNov 9, 2007
  7. Robin RosenbergNov 9, 2007
  8. Johannes SixtNov 9, 2007
  9. David SymondsNov 9, 2007
  10. git-checkout: Test for relative path use.David Symonds, Nov 9, 2007
  11. Junio C HamanoNov 9, 2007
  12. David SymondsNov 9, 2007
  13. Junio C HamanoNov 9, 2007
  14. David SymondsNov 9, 2007
  15. git-checkout: Test for relative path use.David Symonds, Nov 9, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.