From: Jeff King Date: Wed, 01 Jun 2016 19:07:59 GMT Subject: Re: [BUG] git-submodule has bash-ism? Message-ID: <20160601190759.GB12496@sigill.intra.peff.net> In-Reply-To: <20160601183100.GN1355@john.keeping.me.uk> On Wed, Jun 01, 2016 at 07:31:00PM +0100, John Keeping wrote: > > > reset_submodule_urls () { > > > - local root > > > - root=$(pwd) && > > > ( > > > + root=$(pwd) && > > > cd super-clone/submodule && > > > git config remote.origin.url "$root/submodule" > > > ) && > > > ( > > > + root=$(pwd) && > > > cd super-clone/submodule/sub-submodule && > > > git config remote.origin.url "$root/submodule" > [...] > I wonder if it's relevant that the "local root" line isn't &&-chained? > Is it possible that on some shells we ignore an error but everything > still works? I don't think so. We're inside a function, so we wouldn't affect any outer &&-chaining in the function (and there isn't any in the caller anyway). I think it's a reasonable custom not to bother &&-chaining "local" lines, as they come at the top of a function and can't fail. -Peff