If an upstream repository chooses a default branch other than master, and the recipe doesn't specify that branch, cloning will fail. Here is an example:
https://github.com/minad/marginalia/issues/24
(In this case, it so happens that without f89731c (melpa/melpa#7274), it would have worked, but this does not negate the fact that straight.el should be handling default branches correctly.)
(straight-use-package marginalia) will result in the git clone failure shown in https://github.com/minad/marginalia/issues/24. This is because straight-vc-git-default-branch results in a default branch choice of master, which results in straight.el attempting to clone with --branch master.
If no branch is specified, simply omit the --branch option from the git clone command. This will allow git clone to do the right thing. In fact I'm not sure if there's any need for straight-vc-git-default-branch at all; ideally it could be scrapped, because git already knows how to figure out the default branch, and in general that should not be overridden.
Is this occurring for you on the most recent version of the development branch?
The following test case builds fine and has marganila checked out at it's "main" branch on my system:
Test Case
(straight-bug-report
:user-dir "straight-marginalia"
:pre-bootstrap
(setq straight-repository-branch "develop")
:post-bootstrap
(straight-use-package
'(marginalia :post-build
(message
(shell-command-to-string "git branch")))))
2020-12-13 23:29:51gnu/linuxprerelease (HEAD -> develop, origin/develop) 742bc66 2020-12-05GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.23, cairo version 1.17.4)
of 2020-12-05Output
Bootstrapping straight.el...
Bootstrapping straight.el...done
Rebuilding all packages due to build cache schema change
Looking for gnu-elpa-mirror recipe → Cloning melpa...
Looking for gnu-elpa-mirror recipe → Cloning melpa...done
Looking for emacsmirror-mirror recipe → Cloning gnu-elpa-mirror...
Looking for emacsmirror-mirror recipe → Cloning gnu-elpa-mirror...done
Looking for emacsmirror-mirror recipe → Cloning el-get...
Looking for emacsmirror-mirror recipe → Cloning el-get...done
Looking for straight recipe → Cloning emacsmirror-mirror...
Looking for straight recipe → Cloning emacsmirror-mirror...done
Building straight...
Building straight...done
Test run with version: prerelease (HEAD -> develop, origin/develop) 949a0a7 2020-12-13
Cloning marginalia...
Cloning marginalia...done
Building marginalia...
* main
Building marginalia...done
Oh, nice! I was only testing on master and was not aware of #543 / #630. I can now confirm that this works on develop. Thanks a lot!
Most helpful comment
Oh, nice! I was only testing on
masterand was not aware of #543 / #630. I can now confirm that this works ondevelop. Thanks a lot!