Re: [PATCH v6] submodule: add 'deinit' command
- From
Heiko Voigt <hvoigt@hvoigt.net>
- Date
- Mar 5, 2013, 07:29 UTC
- Message-ID
- <20130305072944.GA4677@sandbox-ub>
- In-Reply-To
- <51351018.20301@web.de>
Hi,
On Mon, Mar 04, 2013 at 10:20:24PM +0100, Jens Lehmann wrote:
Show 7 quoted lines
> diff --git a/git-submodule.sh b/git-submodule.sh > index 004c034..44f70c4 100755 > --- a/git-submodule.sh > +++ b/git-submodule.sh > @@ -547,6 +548,80 @@ cmd_init() > } >
[...]
Show 21 quoted lines
> + > + module_list "$@" | > + while read mode sha1 stage sm_path > + do > + die_if_unmatched "$mode" > + name=$(module_name "$sm_path") || exit > + > + # Remove the submodule work tree (unless the user already did it) > + if test -d "$sm_path" > + then > + # Protect submodules containing a .git directory > + if test -d "$sm_path/.git" > + then > + echo >&2 "$(eval_gettext "Submodule work tree '\$sm_path' contains a .git directory")" > + die "$(eval_gettext "(use 'rm -rf' if you really want to remove it including all of its history)")" > + fi > + > + if test -z "$force" > + then > + git rm -n "$sm_path" || > + die "$(eval_gettext "Submodule work tree '\$sm_path' contains local modifications; use '-f' to discard them")"
Minor nit. IMO, there is an indentation for the || missing here. Maybe Junio can squash that in on his side?
Show 5 quoted lines
> + fi > + rm -rf "$sm_path" || say "$(eval_gettext "Could not remove submodule work tree '\$sm_path'")" > + fi > + > + mkdir "$sm_path" || say "$(eval_gettext "Could not create empty submodule directory '\$sm_path'")"
[...]
Everything else looks good to me.
Cheers Heiko