From d329dc0bd8ea87884c453df864ad58fa5d3f0d62 Mon Sep 17 00:00:00 2001 From: "go-git-renovate[bot]" <245267575+go-git-renovate[bot]@users.noreply.github.com> Date: Sat, 28 Mar 2026 06:45:22 +0000 Subject: [PATCH 1/3] build: Update dependency golangci/golangci-lint to v2.10.1 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9311ed6..58cb0c2 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # renovate: datasource=github-tags depName=golangci/golangci-lint -GOLANGCI_VERSION ?= v2.8.0 +GOLANGCI_VERSION ?= v2.10.1 TOOLS_BIN := $(shell mkdir -p build/tools && realpath build/tools) GOLANGCI = $(TOOLS_BIN)/golangci-lint-$(GOLANGCI_VERSION) From 9dbdbc756ef9817e8e4ab278dc6f6859f73037a1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 28 Mar 2026 08:51:04 +0000 Subject: [PATCH 2/3] build: Update dependency golangci/golangci-lint to v2.11.4 Agent-Logs-Url: https://github.com/go-git/cli/sessions/131966d7-0bf6-4084-a63e-8a7951010c79 Co-authored-by: pjbgf <5452977+pjbgf@users.noreply.github.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 58cb0c2..88e0e03 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # renovate: datasource=github-tags depName=golangci/golangci-lint -GOLANGCI_VERSION ?= v2.10.1 +GOLANGCI_VERSION ?= v2.11.4 TOOLS_BIN := $(shell mkdir -p build/tools && realpath build/tools) GOLANGCI = $(TOOLS_BIN)/golangci-lint-$(GOLANGCI_VERSION) From 43e2e2a1f6525b36621d9d595cfd0580552e2d08 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 28 Mar 2026 08:53:47 +0000 Subject: [PATCH 3/3] fix: fix wsl_v5 lint issues for golangci-lint v2.11.4 Agent-Logs-Url: https://github.com/go-git/cli/sessions/131966d7-0bf6-4084-a63e-8a7951010c79 Co-authored-by: pjbgf <5452977+pjbgf@users.noreply.github.com> --- cmd/gogit-http-server/main.go | 4 ++++ cmd/gogit/clone.go | 1 + cmd/gogit/push.go | 6 ++++++ cmd/gogit/upload-pack.go | 2 ++ cmd/gogit/worktree.go | 3 +++ 5 files changed, 16 insertions(+) diff --git a/cmd/gogit-http-server/main.go b/cmd/gogit-http-server/main.go index 6db156c..5c880f9 100644 --- a/cmd/gogit-http-server/main.go +++ b/cmd/gogit-http-server/main.go @@ -30,18 +30,22 @@ var rootCmd = &cobra.Command{ RunE: func(cmd *cobra.Command, args []string) error { directory := args[0] addr := fmt.Sprintf(":%d", port) + abs, err := filepath.Abs(directory) if err != nil { return fmt.Errorf("failed to get absolute path: %w", err) } log.Printf("Using absolute path: %q", abs) + logger := log.Default() loader := transport.NewFilesystemLoader(osfs.New(abs, osfs.WithBoundOS()), false) gitmw := githttp.NewBackend(loader) handler := LoggingMiddleware(logger, gitmw) + log.Printf("Starting server on %q for directory %q", addr, directory) + if err := http.ListenAndServe(addr, handler); !errors.Is(err, http.ErrServerClosed) { return err } diff --git a/cmd/gogit/clone.go b/cmd/gogit/clone.go index bb9673b..4895530 100644 --- a/cmd/gogit/clone.go +++ b/cmd/gogit/clone.go @@ -56,6 +56,7 @@ var cloneCmd = &cobra.Command{ if cloneTags { opts.Tags = git.TagFollowing } + if cloneProgress { opts.Progress = cmd.OutOrStdout() } diff --git a/cmd/gogit/push.go b/cmd/gogit/push.go index 5346829..30009e0 100644 --- a/cmd/gogit/push.go +++ b/cmd/gogit/push.go @@ -44,9 +44,12 @@ var pushCmd = &cobra.Command{ } var ep *transport.Endpoint + remoteName := git.DefaultRemoteName + if len(args) > 0 { isRemote := false + for remote := range cfg.Remotes { if args[0] == remote { remoteName = remote @@ -55,6 +58,7 @@ var pushCmd = &cobra.Command{ break } } + if !isRemote { // Is this a repository URL? ep, err = transport.NewEndpoint(args[0]) @@ -66,6 +70,7 @@ var pushCmd = &cobra.Command{ } var refspecs []config.RefSpec + if len(args) > 1 { for _, arg := range args[1:] { ref := plumbing.NewBranchReferenceName(arg) @@ -101,6 +106,7 @@ var pushCmd = &cobra.Command{ } var isatty bool + stderr := cmd.ErrOrStderr() if f, ok := stderr.(interface { Fd() uintptr diff --git a/cmd/gogit/upload-pack.go b/cmd/gogit/upload-pack.go index dbb69c9..e06fb62 100644 --- a/cmd/gogit/upload-pack.go +++ b/cmd/gogit/upload-pack.go @@ -35,8 +35,10 @@ var uploadPackCmd = &cobra.Command{ } ctx := cmd.Context() + if uploadPackTimeout > 0 { var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, time.Duration(uploadPackTimeout)*time.Second) defer cancel() } diff --git a/cmd/gogit/worktree.go b/cmd/gogit/worktree.go index 3648c28..16c16f3 100644 --- a/cmd/gogit/worktree.go +++ b/cmd/gogit/worktree.go @@ -62,6 +62,7 @@ var worktreeAddCmd = &cobra.Command{ if worktreeAddDetach { opts = append(opts, worktree.WithDetachedHead()) } + if worktreeAddCommit != "" { hash := plumbing.NewHash(worktreeAddCommit) if !hash.IsZero() { @@ -121,6 +122,7 @@ var worktreeListCmd = &cobra.Command{ commonDir := wts.Filesystem() for _, name := range worktrees { gitdirPath := filepath.Join(commonDir.Root(), "worktrees", name, "gitdir") + gitdirData, err := os.ReadFile(gitdirPath) if err != nil || len(gitdirData) == 0 { continue @@ -128,6 +130,7 @@ var worktreeListCmd = &cobra.Command{ wtPath := filepath.Dir(string(gitdirData[:len(gitdirData)-1])) wt := memfs.New() + err = w.Init(wt, name) if err != nil { continue