Skip to content

'cargo install --git' assumes 'master' branch instead of using 'HEAD' #3517

@Nemo157

Description

@Nemo157

When trying to install rustc-l10n I got an error message from cargo

→ cargo install --git https://github.com/xen0n/rustc-l10n
    Updating git repository `https://github.com/xen0n/rustc-l10n`
error: failed to find branch `master`

Manually checking out the repo and looking at the refs I found that it has a HEAD ref pointing to the branch develop

→ git branch -av
* develop                922aea9 docs(README): update README
  remotes/origin/HEAD    -> origin/develop
  remotes/origin/develop 922aea9 docs(README): update README

It seems to me that cargo should probably be installing from the HEAD ref rather than assuming everyone sticks with the master branch convention.

EDIT: Just tried specifying it as a dependency and got the same error as well, I presume if there's anywhere else cargo takes a git repository it likely has the same behaviour.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions