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

bug: Do not hardcode master branch #1697

Open
hyperupcall opened this issue Dec 17, 2023 · 0 comments
Open

bug: Do not hardcode master branch #1697

hyperupcall opened this issue Dec 17, 2023 · 0 comments
Labels

Comments

@hyperupcall
Copy link
Contributor

hyperupcall commented Dec 17, 2023

Describe the Bug

Various parts of the code operate under the assumption that the default branch is the master branch. For example, in command-update.bash:

...
if [ "$update_to_head" = "--head" ]; then
    # Update to latest on the master branch
    git fetch origin master
    git checkout master
    git reset --hard origin/master
    printf "Updated asdf to latest on the master branch\n"
...

As more and more people use main (GitHub now defaults to main), things will either break or require extra work to manually provide the default branch name.

This is related to #974 (which was eventually closed by the OP). Inspired by #1694, which fixes some instances (but not all). It would be a good idea to implement this functionality within a function in utils.bash.

Steps to Reproduce

N/A

Expected Behaviour

To intelligently determine the branch name.

Actual Behaviour

Assumes master

Environment

N/A

asdf plugins affected (if relevant)

N/A

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

No branches or pull requests

1 participant