issue with git submodules and a clone.defaultRemoteName different than origin?

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

 



Hi,

I recently ran into an issue with git submodules because my
clone.defaultRemoteName is not "origin":

> fatal: 'origin' does not appear to be a git repository
> fatal: Could not read from remote repository.
> 
> Please make sure you have the correct access rights
> and the repository exists.
> fatal: Fetched in submodule path 'submodule', but it did not contain <redacted>. Direct fetching of that commit failed.


This appears to be due to the builtin/submodule--helper hard coding
"origin" in "repo_get_default_remote".

I am unsure what the best way to fix this is. I could have the function
read the clone.defaultRemoteName, or I could have it check if there is
only one remote then use that.. or maybe add a new submodule remote name
option?

Thoughts on what the best solution is here?

I'm thinking the following:

1) check if there is only one remote, then use that
2) check clone.defaultRemoteName and use that otherwise
3) fall back to origin otherwise?

Perhaps we could insert a step 0 where we add a config option which will
have submodule clones use the given remote name + use that as the
default when in detached head state?

Thanks,
Jake




[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