From: Sean Barag Date: Mon, 01 Mar 2021 17:17:40 GMT Subject: Re: [BUG?] git submodule update --remote assumes 'origin' remote Message-ID: <58d3b7ba-b65d-432f-872d-adea7fad1317@www.fastmail.com> In-Reply-To: <2d58fe40-9e8c-4653-8170-5411fd3cf6f4@www.fastmail.com> On Mon, Mar 01 2021, Sean Barag wrote: > I've experimented with > introducing fallbacks to `remote_for_branch` in `remote.c` [2] as an > alternative: > > 1. use remote tracking branch; or > 2. if there's only one remote, use that; or > 3. if config.defaultRemoteName is set, use that; or > 4. fall back to "origin" > > This seems to work (at the very least, no tests fail?), but leaves > `cd ./some-sm; git remote add foo bar; git remote rename origin baz` > open to the original behavior. I forgot to mention that this approach requires `get_default_remote` in `submodule--helper.c` to use the name of the remote returned by `remote_get(NULL)`. That was probably obvious to regular mailing list readers :D