asdf icon indicating copy to clipboard operation
asdf copied to clipboard

bug: `asdf update --head` odd behavior

Open hyperupcall opened this issue 1 year ago • 2 comments

Describe the Bug

Currently asdf update --head has a few incorrect underlying assumptions (command-update.bash)

  • Assumes master is default branch (these days more people are configuring Git to use main by default)
  • Assumes "default" remote name is origin (command breaks on rename)
  • It also seems that the "asdf update --head should checkout the master branch" test consistenly breaks when it is ran from a branch other than master

Steps to Reproduce

bats test, asdf update --head

Expected Behaviour

A main branch with configured upstream remote me properly is updated to latest asdf HEAD

Actual Behaviour

  • Branch master gets created

Environment

OS:
Linux Arf 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

SHELL:
GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)
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.11.3-bbcbddc

ASDF ENVIRONMENT VARIABLES:
ASDF_DIR=/home/edwin/.asdf

ASDF INSTALLED PLUGINS:
nodejs                       https://github.com/asdf-vm/asdf-nodejs.git master 644ada3

asdf plugins affected (if relevant)

N/A

hyperupcall avatar Mar 25 '23 10:03 hyperupcall

@hyperupcall Some items you list I was midway through addressing with #1437

It also seems that the "asdf update --head should checkout the master branch" test consistently breaks when it is ran from a branch other than master

This was one case I had not thought of testing against.

I will push my latest changes to this PR and tag you for review to get your thoughts.

jthegedus avatar Mar 26 '23 06:03 jthegedus

Sounds good :+1:

hyperupcall avatar Mar 26 '23 22:03 hyperupcall