GitHub and others are moving to use main as the default branch name. In fact newly created repositories use it by default now. The most recent version/commit of Mint fails to clone tools that donβt have any tags and uses main:
$ mint run rastersize/apollo-codegen
π± Finding latest version of apollo-codegen
π± Cloning apollo-codegen master
Cloning into 'github.com_rastersize_apollo-codegen'...
warning: Could not find remote branch master to clone.
fatal: Remote branch master not found in upstream origin
π± Encountered error during "git clone --depth 1 -b master https://github.com/rastersize/apollo-codegen.git github.com_rastersize_apollo-codegen". Use --verbose to see full output
π± Couldn't clone https://github.com/rastersize/apollo-codegen.git master
This PR aims to resolve that by adding support for both main and master. It should in theory support any name for the default branch as it uses git to look up the name of the branch.
With this patch the invocation above succeeds:
$ .build/debug/mint run rastersize/apollo-codegen apollo-codegen --help
π± Finding latest version of apollo-codegen
π± Cloning apollo-codegen main
π± Resolving package
π± Building package
π± Installed apollo-codegen main
π± Running apollo-codegen main...
OVERVIEW: A utility for performing Apollo GraphQL related tasks.
[...]
GitHub and others are moving to use
main
as the default branch name. In fact newly created repositories use it by default now. The most recent version/commit of Mint fails to clone tools that donβt have any tags and usesmain
:This PR aims to resolve that by adding support for both
main
andmaster
. It should in theory support any name for the default branch as it usesgit
to look up the name of the branch.With this patch the invocation above succeeds: