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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 15, 2006 at 08:07:19PM CET, Junio C Hamano wrote:
> 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
lK[d2%Sa2/d0$^Ixp"|dc`;s/\W//g;$_=pack('H*',/((..)*)$/)
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]