Re: quick bare clones taking longer?
- From
- Dan Nicholson <dbn.lists@gmail.com>
- Date
- May 10, 2007, 20:52 UTC
- Message-ID
- <loom.20070510T224750-851@post.gmane.org>
- In-Reply-To
- <4642DE52.F9F0A5B2@eudaptics.com>
Johannes Sixt <J.Sixt <at> eudaptics.com> writes:
Show 21 quoted lines
>
> Matthieu Moy wrote:
> >
> > Junio C Hamano <junkio <at> cox.net> writes:
> >
> > > get_repo_base() {
> > > - (cd "$1" && (cd .git ; pwd)) 2> /dev/null
> > > + (
> > > + cd "`/bin/pwd`" &&
> > > + cd "$1" &&
> > > + (
> > > + cd .git
> > > + pwd
> > > + )
> > > + ) 2>/dev/null
> > > }
> >
> > Will this work on windows?
>
> Yes. As does the alternative that uses cd -P. MinGW uses bash (3.1
> here).In fact, all POSIX shells should support `cd -P' according to the spec, so it should probably just be used directly instead of hoping that /bin/pwd exists.
(cd -P "$1" && (cd .git ; pwd)) 2>/dev/null
http://www.opengroup.org/onlinepubs/009695399/utilities/cd.html
-- Dan