Skip to content

plugin-update --all fails if git-ref is not master #799

@joschi

Description

@joschi

Describe the bug

asdf plugin update --all fails if one or more plugins don't use master as their default branch.

To Reproduce

  1. asdf plugin install jbang
  2. asdf plugin update --all

Expected behavior

# asdf plugin update --all
Updating java...
Already on 'master'
Your branch is up to date with 'origin/master'.
Updating jbang...
Already on 'main'
Your branch is up to date with 'origin/main'.

asdf should use the default branch of the plugin repository for updates or alternatively only pull the latest changes of the checked out branch even if it's not master.

Actual behavior

# asdf plugin update --all
Updating java...
Already on 'master'
Your branch is up to date with 'origin/master'.
Updating jbang...
fatal: couldn't find remote ref master

When explicitly specifying main as git-ref parameter to asdf plugin update <name> [<git-ref>], the update is successful:

# asdf plugin update jbang main
Updating jbang...
Already on 'main'
Your branch is up to date with 'origin/main'.

Environment

OS:
Darwin joschi-mbp15.lan 19.6.0 Darwin Kernel Version 19.6.0: Thu Jun 18 20:49:00 PDT 2020; root:xnu-6153.141.1~1/RELEASE_X86_64 x86_64 i386 MacBookPro11,3 Darwin

SHELL:
GNU bash, version 5.0.18(1)-release (x86_64-apple-darwin19.5.0)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

ASDF VERSION:
v0.8.0

ASDF ENVIRONMENT VARIABLES:
ASDF_DIR=/usr/local/opt/asdf

ASDF INSTALLED PLUGINS:
java                         https://github.com/halcyon/asdf-java.git
jbang                        https://github.com/joschi/asdf-jbang.git

asdf plugins affected (if relevant):

Additional context

GitHub will start using main as default branch name starting October 1, 2020:

On October 1, 2020, if you haven't changed the default branch for new repositories for your user, organization, or enterprise, it will automatically change from master to main.

Source: https://github.blog/changelog/2020-08-26-set-the-default-branch-for-newly-created-repositories/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions