Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo install --git hardcodes master, doesn't use the default remote branch (HEAD) #8380

Closed
sunshowers opened this issue Jun 18, 2020 · 4 comments
Labels
C-bug Category: bug

Comments

@sunshowers
Copy link
Contributor

Problem

cargo install --git uses the master branch by default. A better default would be to use the default remote branch (aka HEAD), which is typically master but more people have been setting to other names recently.

Steps

cargo install --git https://github.com/sunshowers/non-master-branch

The output is:

    Updating git repository `https://github.com/sunshowers/non-master-branch`error: failed to find branch `master`

Caused by:
  cannot locate local branch 'master'; class=Reference (4); code=NotFound (-3)

Possible Solution(s)

  • Use the default remote branch (a minor BC breakage, but I'd be surprised if it broke anyone).
  • If the BC breakage is too severe, at least warn about this.

Notes

Output of cargo version:

cargo 1.44.0 (05d080faa 2020-05-06)
@sunshowers sunshowers added the C-bug Category: bug label Jun 18, 2020
@Eh2406
Copy link
Contributor

Eh2406 commented Jun 18, 2020

CC #8364

@sunshowers
Copy link
Contributor Author

CC #8364

Thanks! Looks like this is addressed by that PR.

@Erk-
Copy link

Erk- commented Jun 18, 2020

Duplicate of #3517

@carols10cents
Copy link
Member

Closing as duplicate of #3517

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

4 participants