From b7771d7b0b7ef3b813abc7dd1e3f8b0892de3006 Mon Sep 17 00:00:00 2001 From: Nathan Nutter Date: Fri, 17 Jul 2026 12:54:19 -0500 Subject: [PATCH] Downgrade go-git due to worktreeConfig bug go-git added extension verification which apparently has a bug, https://github.com/go-git/go-git/issues/2156 Downgrading is not great but it's a workaround for now. --- go.mod | 3 +-- go.sum | 6 ++---- internal/gitwt/gitwt_test.go | 10 ++++++++++ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 74e0ae4..c3e9449 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( charm.land/fang/v2 v2.0.1 charm.land/lipgloss/v2 v2.0.1 github.com/charmbracelet/huh v1.0.0 - github.com/go-git/go-git/v5 v5.19.1 + github.com/go-git/go-git/v5 v5.16.5 github.com/google/uuid v1.6.0 github.com/samber/lo v1.53.0 github.com/spf13/cobra v1.10.1 @@ -16,7 +16,6 @@ require ( dario.cat/mergo v1.0.2 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/ProtonMail/go-crypto v1.4.1 // indirect - github.com/adrg/xdg v0.5.3 // indirect github.com/atotto/clipboard v0.1.4 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/catppuccin/go v0.3.0 // indirect diff --git a/go.sum b/go.sum index 5e725e7..6cd81c4 100644 --- a/go.sum +++ b/go.sum @@ -11,8 +11,6 @@ github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERo github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/ProtonMail/go-crypto v1.4.1 h1:9RfcZHqEQUvP8RzecWEUafnZVtEvrBVL9BiF67IQOfM= github.com/ProtonMail/go-crypto v1.4.1/go.mod h1:e1OaTyu5SYVrO9gKOEhTc+5UcXtTUa+P3uLudwcgPqo= -github.com/adrg/xdg v0.5.3 h1:xRnxJXne7+oWDatRhR1JLnvuccuIeCoBu2rtuLqQB78= -github.com/adrg/xdg v0.5.3/go.mod h1:nlTsY+NNiCBGCK2tpm09vRqfVzrc2fLmXGpBLF0zlTQ= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= @@ -89,8 +87,8 @@ github.com/go-git/go-billy/v5 v5.9.0 h1:jItGXszUDRtR/AlferWPTMN4j38BQ88XnXKbilmm github.com/go-git/go-billy/v5 v5.9.0/go.mod h1:jCnQMLj9eUgGU7+ludSTYoZL/GGmii14RxKFj7ROgHw= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= -github.com/go-git/go-git/v5 v5.19.1 h1:nX27AnaU43/K5bKktKwgBmR9lawoYVe1Ckg0rgzzN00= -github.com/go-git/go-git/v5 v5.19.1/go.mod h1:Pb1v0c7/g8aGQJwx9Us09W85yGoyvSwuhEGMH7zjDKQ= +github.com/go-git/go-git/v5 v5.16.5 h1:mdkuqblwr57kVfXri5TTH+nMFLNUxIj9Z7F5ykFbw5s= +github.com/go-git/go-git/v5 v5.16.5/go.mod h1:QOMLpNf1qxuSY4StA/ArOdfFR2TrKEjJiye2kel2m+M= github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 h1:f+oWsMOmNPc8JmEHVZIycC7hBoQxHH9pNKQORJNozsQ= github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8/go.mod h1:wcDNUvekVysuuOpQKo3191zZyTpiI6se1N1ULghS0sw= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= diff --git a/internal/gitwt/gitwt_test.go b/internal/gitwt/gitwt_test.go index 502330b..cbbf734 100644 --- a/internal/gitwt/gitwt_test.go +++ b/internal/gitwt/gitwt_test.go @@ -75,6 +75,16 @@ func TestCreateListAndRemoveLifecycle(t *testing.T) { testRepository.assertPathMissing(t, testRepository.worktreePath(branchName)) } +func TestCreateSucceedsWithWorktreeConfig(t *testing.T) { + testRepository := newTestRepository(t) + runGitCommand(t, testRepository.mainPath, "config", "extensions.worktreeConfig", "true") + + result := testRepository.runGitWT(t, "create", "feature/worktree-config") + if result.err != nil { + t.Fatalf("create failed: %v\n%s", result.err, result.stderr) + } +} + func TestCreateFailsWhenBranchExists(t *testing.T) { const branchName = "feature/existing" const workFileName = "work.txt"