detached 6881eb3

fix(config): accept extensions.preciousObjects and relativeWorktrees (GO-009)

commit
6881eb3b67e63d6a09ceaf05776e63a4fbbc97be
author
brice · · 2026-10-10 22:15 UTC
parent
eb2657a
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
2 files · +7 -2
M config.go +5 -2
@@ -79,8 +79,11 @@ func checkConfigData(data []byte) error {
7979 if !strings.EqualFold(val, "files") {
8080 return unsupported("extensions.refstorage = %s", truncate(val))
8181 }
82- case "noop", "worktreeconfig":
83- // No effect on reading a bare repository.
82+ case "noop", "worktreeconfig", "preciousobjects", "relativeworktrees":
83+ // No effect on reading: preciousobjects only forbids
84+ // deleting objects, relativeworktrees changes how linked
85+ // worktrees point at the repository (they are rejected
86+ // anyway).
8487 default:
8588 return unsupported("extensions.%s", truncate(key))
8689 }
@@ -79,8 +79,11 @@ func checkConfigData(data []byte) error {
79 if !strings.EqualFold(val, "files") {79 if !strings.EqualFold(val, "files") {
80 return unsupported("extensions.refstorage = %s", truncate(val))80 return unsupported("extensions.refstorage = %s", truncate(val))
81 }81 }
82- case "noop", "worktreeconfig":82+ case "noop", "worktreeconfig", "preciousobjects", "relativeworktrees":
83- // No effect on reading a bare repository.83+ // No effect on reading: preciousobjects only forbids
84+ // deleting objects, relativeworktrees changes how linked
85+ // worktrees point at the repository (they are rejected
86+ // anyway).
84 default:87 default:
85 return unsupported("extensions.%s", truncate(key))88 return unsupported("extensions.%s", truncate(key))
86 }89 }
M open_test.go +2 -0
@@ -17,6 +17,8 @@ func TestConfigChecks(t *testing.T) {
1717 "[core]\n\trepositoryformatversion = 1\n[extensions]\n\tobjectformat = sha1\n\trefstorage = files\n",
1818 "[core]\n\trepositoryformatversion = 1\n[extensions]\n\tObjectFormat = SHA1 # comment\n",
1919 "[core]\n\trepositoryformatversion = 1\n[extensions]\n\tnoop = true\n\tworktreeConfig = true\n",
20+ "[core]\n\trepositoryformatversion = 1\n[extensions]\n\tpreciousObjects = true\n\tRelativeWorktrees = true\n",
21+ "[core]\n\trepositoryformatversion = 1\n[EXTENSIONS]\n\tPRECIOUSOBJECTS = true\n\trelativeworktrees = true\n",
2022 "[remote \"origin\"]\n\turl = x\n[extensions-lookalike]\n\tfoo = bar\n",
2123 "# comment\n; comment\n[core]\nrepositoryformatversion=0\n",
2224 "[branch \"extensions\"]\n\tobjectformat = sha256\n",
@@ -17,6 +17,8 @@ func TestConfigChecks(t *testing.T) {
17 "[core]\n\trepositoryformatversion = 1\n[extensions]\n\tobjectformat = sha1\n\trefstorage = files\n",17 "[core]\n\trepositoryformatversion = 1\n[extensions]\n\tobjectformat = sha1\n\trefstorage = files\n",
18 "[core]\n\trepositoryformatversion = 1\n[extensions]\n\tObjectFormat = SHA1 # comment\n",18 "[core]\n\trepositoryformatversion = 1\n[extensions]\n\tObjectFormat = SHA1 # comment\n",
19 "[core]\n\trepositoryformatversion = 1\n[extensions]\n\tnoop = true\n\tworktreeConfig = true\n",19 "[core]\n\trepositoryformatversion = 1\n[extensions]\n\tnoop = true\n\tworktreeConfig = true\n",
20+ "[core]\n\trepositoryformatversion = 1\n[extensions]\n\tpreciousObjects = true\n\tRelativeWorktrees = true\n",
21+ "[core]\n\trepositoryformatversion = 1\n[EXTENSIONS]\n\tPRECIOUSOBJECTS = true\n\trelativeworktrees = true\n",
20 "[remote \"origin\"]\n\turl = x\n[extensions-lookalike]\n\tfoo = bar\n",22 "[remote \"origin\"]\n\turl = x\n[extensions-lookalike]\n\tfoo = bar\n",
21 "# comment\n; comment\n[core]\nrepositoryformatversion=0\n",23 "# comment\n; comment\n[core]\nrepositoryformatversion=0\n",
22 "[branch \"extensions\"]\n\tobjectformat = sha256\n",24 "[branch \"extensions\"]\n\tobjectformat = sha256\n",

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 2

↑↓ moveenter openesc close