Re: [RFC PATCH 1/2] rm: don't fail when removing populated submodules
- From
Jens Lehmann <jens.lehmann@web.de>
- Date
- Aug 19, 2012, 19:38 UTC
- Message-ID
- <503140C8.3090603@web.de>
- In-Reply-To
- <CABURp0qujqHRg+PkScNGbHccHyheJZesWBsJSC=crhUczOG7Mg@mail.gmail.com>
Am 17.08.2012 20:11, schrieb Phil Hord:
Show 11 quoted lines
> On Fri, Aug 17, 2012 at 12:44 PM, Jens Lehmann <Jens.Lehmann@web.de> wrote: >> >> I'm almost there. The only thing left is to check if a nested >> submodule is using a git directory. In that case I expect "rm" to >> fail even when -f is used to protect the submodule's history. I >> still need to find a suitable command for recursing the submodules >> and doing that check. > > I suppose the style of this is wrong, but this seems to work for me. > > git submodule foreach --recursive '! test -f .git'
Thanks! I was looking for something less expensive, but given that I don't expect removing submodules to be a performance critical operation this test should just work fine.