Skip to content

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

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)

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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