Bare git repositories may have no HEAD, it happens sometimes. It's ok when we have such repository in our EGIT_REPO_URI since it's enough to set some valid EGIT_BRANCH to avoid a fetching error "fatal: Couldn't find remote ref HEAD". It works even if we want to work with the particular commit and have set EGIT_COMMIT -- they work together perferctly. The problem raises when the main repository has a submodule and this submodule's repository doesn't have any HEAD. This is what git-r3 does not expect and it doesn't allow to eigher turn off submodule loading (if it's not needed) or to set some branch to be looked at instead of the HEAD. So, I propose to change the logic of fetching in case fetched repository has no HEAD but still has some branch.
Could you point me to an ebuild I could use to test this?
Possibly the fix from bug #524146 could solve this as well.
Expanding on this, it looks weird to me. AFAIR HEAD on a bare repository specifies the default branch to fetch, so what is fetched when you want to clone it? Does git have some implicit fallback to 'master'? Should we maybe do a full mirror-style clone in this scenario?
I'm closing due to lack of reply. Please reopen when you can provide the details needed for testing this.