Skip to content

git deps: use branch "main" if "master" does not exist #8946

@birkenfeld

Description

@birkenfeld

With more projects switching to their primary branch being called "main" instead of "master", simply adding a git dependency will fail. This is a usability issue, and since I assume the Rust project supports the use of this alternate nomenclature, it should do its part to support it.

E.g. with ureq:

error: failed to get `ureq` as a dependency of package ...

Caused by:
  failed to load source for dependency `ureq`

Caused by:
  Unable to update https://github.com/algesten/ureq

Caused by:
  failed to find branch `master`

Caused by:
  cannot locate remote-tracking branch 'origin/master'; class=Reference (4); code=NotFound (-3)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions