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

Re: [PATCH] git-checkout: allow pathspec to recover lost working tree directory

From
Petr Baudis <pasky@suse.cz>
Date
Nov 17, 2006, 15:44 UTC
Message-ID
<20061117154459.GF7201@pasky.or.cz>
In-Reply-To
<7vbqn8msuw.fsf@assigned-by-dhcp.cox.net>
On Wed, Nov 15, 2006 at 08:07:19PM CET, Junio C Hamano wrote:
Show 17 quoted lines
> diff --git a/git-checkout.sh b/git-checkout.sh
> index eb28b29..737abd0 100755
> --- a/git-checkout.sh
> +++ b/git-checkout.sh
> @@ -112,7 +112,11 @@ Did you intend to checkout '$@' which ca
>  		git-ls-tree --full-name -r "$new" "$@" |
>  		git-update-index --index-info || exit $?
>  	fi
> -	git-checkout-index -f -u -- "$@"
> +
> +	# 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
>  	exit $?
>  else
>  	# Make sure we did not fall back on $arg^{tree} codepath

Wouldn't it be better to fix git-checkout-index to checkout a whole directory if specified?

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
Previous: Junio C Hamano
Message 4 of 4 in “git-checkout: allow pathspec to recover lost working tree directory”
  1. git-checkout: allow pathspec to recover lost working tree directoryJunio C Hamano, Nov 15, 2006
  2. Anand KumriaNov 16, 2006
  3. Junio C HamanoNov 16, 2006
  4. Petr BaudisNov 17, 2006

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.