From: Lars Hjemli Date: Sun, 17 Jun 2007 15:56:15 GMT Subject: Re: [PATCH 1/2] git-submodule: move cloning into a separate function Message-ID: <8c5c35580706170856n64747190xeaf88fc2deafd273@mail.gmail.com> In-Reply-To: <20070617143802.GV955MdfPADPa@greensroom.kotnet.org> On 6/17/07, Sven Verdoolaege wrote: > On Tue, Jun 05, 2007 at 01:13:28PM +0200, Lars Hjemli wrote: > > +module_clone() > > +{ > > + path=$1 > > + url=$2 > > + > > + # If there already is a directory at the submodule path, > > + # expect it to be empty (since that is the default checkout > > + # action) and try to remove it. > > + # Note: if $path is a symlink to a directory the test will > > + # succeed but the rmdir will fail. We might want to fix this. > > + if test -d "$path" > > + then > > + rmdir "$path" 2>/dev/null || > > + die "Directory '$path' exist, but is neither empty nor a git repository" > > What makes you say that '$path' is not a git repository? > The function assumes it's only invoked when no repo is present in $path/.git. -- larsh