Fix go-git Compilation and Import Ordering

With an isolated git config the entire suite passes. Done.
Summary
The go-git bump (v6.0.0-alpha.4.0.20260521... → ...20260713100844-d5e9b9c7895b) added a protocol.Version parameter to transport.AdvertiseRefs. Its new signature:
Three test-only git-server helpers called the old 5-arg form. I fixed each by adding the protocol import and passing protocol.V0 (the classic v0/v1 info/refs advertisement these helpers serve, preserving prior behavior):
client_test.go:186cmd/git-sync/main_test.go:814internal/syncer/integration_test.go:3776
go build ./... and go vet ./... now pass, and the full test suite passes.
Note on the test failures you'd otherwise see: a batch of tests fail with cannot auto-sign commit: disable commit.gpgSign or register an ObjectSigner plugin (and the SSH shim test with agent refused operation). These are not caused by the bump — they reproduce identically on the pre-bump go.mod and stem from your global commit.gpgSign=true / gpg.format=ssh config leaking into go-git's in-memory commits. Running with an isolated git config (GIT_CONFIG_GLOBAL=/dev/null GIT_CONFIG_SYSTEM=/dev/null) makes the whole suite green.
The style hints flagged in integration_test.go (CutPrefix, min, slices.Contains) are pre-existing and unrelated — I left them alone.
Fix the linting issues:
[lint:shellcheck] Finished in 171.1ms [lint:gofmt] These .go files need to be formatted: [lint:gofmt] [lint:gofmt] client_test.go [lint:gofmt] [lint:gofmt] To fix: mise run fmt Finished in 179.5ms [lint:gofmt] ERROR task failed Error: Process completed with exit code 1.
Fixed. The protocol import was out of alphabetical order; gofmt -w corrected it. gofmt -l now reports the file as clean.
The version of the model being used that is added as a Assisted-By trailer seems incorrect. Fix that in the claude attribution file.
Fixed — the attribution in /home/coder/.claude/settings.json now reads Claude Opus 4.8.
Note: the commit I just made (039dfc5) still carries the old Claude Opus 4.7 trailer. It hasn't been pushed yet, so I can amend it to 4.8 if you'd like — want me to?
The signing agent refused the operation — your SSH signing key needs unlocking (the agent-timeout situation your CLAUDE.md notes). Once you've unlocked it, tell me and I'll re-run the amend. The staged message is ready with the corrected Claude Opus 4.8 trailer.
Done. Amended to 5da218a with the corrected Assisted-by: Claude Opus 4.8 trailer, now properly signed.
Update tests so that they ignore system/global level config settings (e.g. commit.gpgSign=true)
Done. All tests now ignore system/global git config, verified with the developer's real commit.gpgSign=true still active.
What I did
The root cause: go-git's x/plugin registers xconfig.NewAuto() as the default ConfigLoader at init time, which reads the host's real ~/.gitconfig and /etc/gitconfig. That pulled commit.gpgSign=true into every go-git in-memory commit, and the real git binary in the SSH tests read it independently.
Rather than the go-git-only plugin override that internal/syncer was already using (which left the SSH test broken), I used a single mechanism that both go-git's loader and the git binary honor: GIT_CONFIG_GLOBAL/GIT_CONFIG_SYSTEM pointed at os.DevNull.
internal/syncertest/repo.go— addedIsolateGitConfig(), which sets those two env vars. Documented why it usesos.Setenv(the suites uset.Parallel(), which forbidst.Setenv), so it must be called fromTestMain.client_test.go(rootgitsync) — added aTestMaincalling it.internal/strategy/materialized/materialized_test.go— added aTestMaincalling it.cmd/git-sync/main_test.go— added the call to the existingTestMain.internal/syncer/integration_test.go— replaced the go-git-only plugin registration withIsolateGitConfig()(this also fixes the SSH shim test), dropped the now-unusedx/pluginandx/plugin/configimports, and switchedm.Run()→os.Exit(m.Run())so failures actually propagate.
The remaining lint hints in integration_test.go/materialized_test.go (CutPrefix, min, slices.Contains) are pre-existing and unrelated — I left them untouched. Nothing is committed yet.
The signing agent refused again — your SSH signing key needs unlocking. Once you've unlocked it, say the word and I'll re-run the commit (changes are already staged).