Re: [BUG?] git submodule update --remote assumes 'origin' remote
- From
Sean Barag <sean@barag.org>
- Date
- Mar 1, 2021, 17:17 UTC
- 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:
Show 12 quoted lines
> 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