Skip to content

Conversation

@dbabokin
Copy link
Contributor

@dbabokin dbabokin commented Mar 27, 2025

Missing default branches causes fails if the project is imported through CMake's FetchContent mechanism. It checks out the default branch and then switches to the pinned SHA. If the default branch is not specified, it assumes "origin/master", which doesn't always exist.

Here's the fail that I observe:

Submodule path 'ext/c4core/cmake': checked out 'e87e11f1a10af8aab4e0ceaade0bc7807f207eb1'
Submodule path 'ext/c4core/src/c4/ext/debugbreak': checked out '328e4abca3384cbd0a69e70f263cc7b2794bff09'
fatal: Needed a single revision
Unable to find current origin/master revision in submodule path 'src/c4/ext/fast_float'

The issue is reproduced only with relatively old git, for example with the one that come with Ubuntu 20.04.

Missing default branches causes fails if the project is imported through
CMake's FetchContent mechanism. It checks out the default branch and the
switches to the pinned SHA. If the default branch is not specified, it
assumes "origin/master", which doesn't always exist.
@biojppm
Copy link
Owner

biojppm commented Mar 27, 2025

Thanks!

@biojppm biojppm merged commit 636e3a6 into biojppm:master Mar 27, 2025
253 of 259 checks passed
@dbabokin dbabokin deleted the dbabokin-submodule branch March 27, 2025 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants