bug: `asdf plugin test <plugin> . --asdf-plugin-gitref <ref>` does not recognize git SHA commits
- Dominant language
- Go
- Stars
- 25.6k
- Forks
- 941
- Avg merge
- 9h 24m
- Merged PRs (30d)
- 3
Description
### Describe the Bug
`asdf plugin test` does not recognize git SHA commits for `--asdf-plugin-gitref`.
### Steps to Reproduce
Here is a minimal Dockerfile to reproduce the issue:
```Dockerfile
FROM debian:bookworm
ENV DEBIAN_FRONTEND=noninteractive
ENV PATH="/root/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# Install deps, go, and asdf
RUN \
echo "Types: deb deb-src" >> /etc/apt/sources.list.d/debian-backports.sources && \
echo "URIs: http://deb.debian.org/debian" >> /etc/apt/sources.list.d/debian-backports.sources && \
echo "Suites: bookworm-backports" >> /etc/apt/sources.list.d/debian-backports.sources && \
echo "Components: main" >> /etc/apt/sources.list.d/debian-backports.sources && \
echo "Enabled: yes" >> /etc/apt/sources.list.d/debian-backports.sources && \
echo "Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg" >> /etc/apt/sources.list.d/debian-backports.sources && \
apt-get update -q -y && \
apt-get -qq install -y ca-certificates curl gnupg git xz-utils build-essential && \
apt-get install -qq -y -t bookworm-backports golang-go && \
go install github.com/asdf-vm/asdf/cmd/asdf@master
# Test asdf-nim plugin
ENV PLUGIN_REF=4ed0673ed822055894b2ef57cd08d3f6a1bf6079
RUN \
git clone https://github.com/elijahr/asdf-nim.git && \
cd asdf-nim && \
git checkout "${PLUGIN_REF}" && \
asdf plugin test nim . --asdf-tool-version 2.2.4 --asdf-plugin-gitref "${PLUGIN_REF}"
```
### Expected Behaviour
The plugin should be tested using the filesystem state at the specified git commit.
### Actual Behaviour
```
FAILED: nim was not properly installed reason: unable to clone plugin: fatal: Remote branch 4ed0673ed822055894b2ef57cd08d3f6a1bf6079 not found in upstream origin
```
### Environment
```shell
linux
```
### asdf plugins affected (if relevant)
asdf-nim
Contributor guide
Research direction
Start by tracing the `asdf plugin test` command's handling of `--asdf-plugin-gitref`, then reproduce the failure with the Dockerfile and SHA shown in the issue. Done means a plugin checked out at a git SHA is tested using that filesystem state rather than attempting to clone the SHA as a remote branch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, go
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100