From: Petr Baudis Date: Fri, 17 Nov 2006 15:44:59 GMT Subject: Re: [PATCH] git-checkout: allow pathspec to recover lost working tree directory 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: > 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