FetchContent_MakeAvailable: invalid reference master

I am using CMake in my project, and a bug is reported.

My CMakeLists.txt is:


And it reports a bug:

Performing download step (git clone) for 'sutk-populate'
Cloing into 'SUTK'
fatal: invalid reference: master
CMake Error at build/_deps/sutk-subbuild/..../sutk-populate-gitclone.cmake:40 (message):
  Failed to checkout tag: 'master'

Actually, there is no master branch in my repo. Because the default branch name is main.

How to fix this bug? Any suggestion is appreciated~~~

You should also provide a GIT_TAG "origin/main" argument; the default is “master”, not “nothing” which let’s Git determine the default on its own. I’ll update the docs.

@ben.boeckel Thank you very much~~~