Issue related to git submodules, tracking branches and custom remote names

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, 
I think there's an unexpected behaviour related to git submodules, tracking branches and custom remote names.

What did you do before the bug happened? (Steps to reproduce your issue)

1. Inside any git repo add a submodule via `git submodule add -b <branch> <repo-url>`
2. git submodule update --init
3. cd <submodule-repo> && git remote rename origin internal
3. git submodule update --remote

What did you expect to happen? (Expected behavior)

Command should be successful with: `Submodule path '<submodule>': checked out 'commit-hash'`

What happened instead? (Actual behavior)

`fatal: Unable to find refs/remotes/origin/branch revision in submodule path '<submodule>'`

What's different between what you expected and what actually happened?

As you can see in the error message, it's looking for the branch in the `origin` remote, which was renamed to `internal`.

Anything else you want to add:

I'd expect for git to either properly detect the changed remote or be able to specify it somewhere. I've looked into the https://git-scm.com/docs/gitmodules reference and couldn't find a setting for setting a custom remote there.

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.


[System Info]
git version:
git version 2.39.3 (Apple Git-145)
cpu: arm64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
uname: Darwin 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:10:42 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6000 arm64
compiler info: clang: 15.0.0 (clang-1500.1.0.2.5)
libc info: no libc information available
$SHELL (typically, interactive shell): /bin/zsh


[Enabled Hooks]
commit-msg
post-commit
pre-merge-commit

Thanks for looking into it,
Sergiu






[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux