From: Đoàn Trần Công Danh Date: Sun, 17 May 2020 16:11:51 GMT Subject: Re: [PATCH 1/2] submodule: port subcommand 'set-branch' from shell to C Message-ID: <20200517161151.GA30938@danh.dev> In-Reply-To: <20200513201737.55778-1-shouryashukla.oo@gmail.com> On 2020-05-14 01:47:36+0530, Shourya Shukla wrote: > diff --git a/git-submodule.sh b/git-submodule.sh > index 39ebdf25b5..2438ef576e 100755 > --- a/git-submodule.sh > +++ b/git-submodule.sh > @@ -719,7 +719,6 @@ cmd_update() > # $@ = requested path > # > cmd_set_branch() { > - unset_branch=false > branch= > > while test $# -ne 0 > @@ -729,7 +728,7 @@ cmd_set_branch() { > # we don't do anything with this but we need to accept it > ;; > -d|--default) > - unset_branch=true > + default=1 Hi Shourya, Thanks for your hard work, I skimmed over the current code, it seems like this: default=1 is new. If my understanding is correct, please reset its value in the beginning of this function, to avoid: - a side effect from an assignment in get_submodule_config (if there's such a side effect, I'm NOT really sure). - effect of an environment variable, c.f. https://lore.kernel.org/git/20200402084251.85840-1-zhiyou.jx@alibaba-inc.com/ -- Danh