detached 2b3076b

fix(bootstrap): prepend v prefix to version for correct git ref resolution

commit
2b3076bdcc326f928014e3f9609a231a10d8e077
author
brice · · 2026-04-03 15:15 UTC
parent
53b3337
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
2 files · +16 -0
M internal/config/config.go +3 -0
@@ -222,6 +222,9 @@ func bootstrapRef(version string) string {
222222 case strings.Contains(version, "-next"):
223223 return "dev"
224224 default:
225+ if !strings.HasPrefix(version, "v") {
226+ return "v" + version
227+ }
225228 return version
226229 }
227230 }
@@ -222,6 +222,9 @@ func bootstrapRef(version string) string {
222 case strings.Contains(version, "-next"):222 case strings.Contains(version, "-next"):
223 return "dev"223 return "dev"
224 default:224 default:
225+ if !strings.HasPrefix(version, "v") {
226+ return "v" + version
227+ }
225 return version228 return version
226 }229 }
227 }230 }
M internal/config/config_test.go +13 -0
@@ -26,6 +26,19 @@ func TestNewConfig_UsesDevRefForDevelopmentBuilds(t *testing.T) {
2626 }
2727 }
2828
29+func TestNewConfig_GoReleaserVersionWithoutVPrefix(t *testing.T) {
30+ // GoReleaser strips the 'v' prefix: version={{.Version}} yields "0.5.1" not "v0.5.1".
31+ cfg := NewConfig("0.5.1")
32+
33+ if cfg.RawURL != "https://raw.githubusercontent.com/bnema/archup/v0.5.1" {
34+ t.Fatalf("expected v-prefixed raw URL, got %q", cfg.RawURL)
35+ }
36+
37+ if cfg.Branch() != "v0.5.1" {
38+ t.Fatalf("expected v-prefixed branch, got %q", cfg.Branch())
39+ }
40+}
41+
2942 func TestNewConfig_ENVDevOverridesReleaseVersion(t *testing.T) {
3043 t.Setenv("ENV", "dev")
3144
@@ -26,6 +26,19 @@ func TestNewConfig_UsesDevRefForDevelopmentBuilds(t *testing.T) {
26 }26 }
27 }27 }
28 28
29+func TestNewConfig_GoReleaserVersionWithoutVPrefix(t *testing.T) {
30+ // GoReleaser strips the 'v' prefix: version={{.Version}} yields "0.5.1" not "v0.5.1".
31+ cfg := NewConfig("0.5.1")
32+
33+ if cfg.RawURL != "https://raw.githubusercontent.com/bnema/archup/v0.5.1" {
34+ t.Fatalf("expected v-prefixed raw URL, got %q", cfg.RawURL)
35+ }
36+
37+ if cfg.Branch() != "v0.5.1" {
38+ t.Fatalf("expected v-prefixed branch, got %q", cfg.Branch())
39+ }
40+}
41+
29 func TestNewConfig_ENVDevOverridesReleaseVersion(t *testing.T) {42 func TestNewConfig_ENVDevOverridesReleaseVersion(t *testing.T) {
30 t.Setenv("ENV", "dev")43 t.Setenv("ENV", "dev")
31 44

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 0

    ↑↓ moveenter openesc close