From 78f3688f31272e886ced74c4c7654296d23c1e18 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 26 Aug 2025 20:29:34 +0000 Subject: [PATCH] Fix additional exhaustive issues and service-related switch cases Co-authored-by: andreynering <7011819+andreynering@users.noreply.github.com> --- pkg/daemon/daemon.go | 4 ++++ pkg/ssh/cmd/git.go | 10 ++++++++++ pkg/ui/pages/repo/files.go | 4 ++++ pkg/web/git.go | 2 ++ 4 files changed, 20 insertions(+) diff --git a/pkg/daemon/daemon.go b/pkg/daemon/daemon.go index bcc6cbe4287c662a84c91b26283c66fa8efaf832..e57576474e0127c15468282fa880e4de70d30297 100644 --- a/pkg/daemon/daemon.go +++ b/pkg/daemon/daemon.go @@ -206,6 +206,10 @@ func (d *GitDaemon) handleClient(conn net.Conn) { counter = uploadPackGitCounter case git.UploadArchiveService: counter = uploadArchiveGitCounter + case git.ReceivePackService, git.LFSTransferService: + // These services don't have counters in this context + d.fatal(c, git.ErrInvalidRequest) + return default: d.fatal(c, git.ErrInvalidRequest) return diff --git a/pkg/ssh/cmd/git.go b/pkg/ssh/cmd/git.go index 6ae65898324f24c382fa881a5e7b971980e5966b..7837cf85d50bc4adf86adf4cf87dbc7a84422ba7 100644 --- a/pkg/ssh/cmd/git.go +++ b/pkg/ssh/cmd/git.go @@ -280,6 +280,11 @@ func gitRunE(cmd *cobra.Command, args []string) error { defer func() { uploadArchiveSeconds.WithLabelValues(name).Add(time.Since(start).Seconds()) }() + case git.UploadPackService, git.ReceivePackService, git.LFSTransferService: + uploadPackCounter.WithLabelValues(name).Inc() + defer func() { + uploadPackSeconds.WithLabelValues(name).Add(time.Since(start).Seconds()) + }() default: uploadPackCounter.WithLabelValues(name).Inc() defer func() { @@ -326,6 +331,11 @@ func gitRunE(cmd *cobra.Command, args []string) error { defer func() { lfsTransferSeconds.WithLabelValues(name, operation).Add(time.Since(start).Seconds()) }() + case git.UploadPackService, git.UploadArchiveService, git.ReceivePackService: + lfsAuthenticateCounter.WithLabelValues(name, operation).Inc() + defer func() { + lfsAuthenticateSeconds.WithLabelValues(name, operation).Add(time.Since(start).Seconds()) + }() default: lfsAuthenticateCounter.WithLabelValues(name, operation).Inc() defer func() { diff --git a/pkg/ui/pages/repo/files.go b/pkg/ui/pages/repo/files.go index 7ae477e8cb73b86320d4f2b44da60cd8d6c63c13..6e8c4affdc51fad43d065d9e3f24f8664723fb14 100644 --- a/pkg/ui/pages/repo/files.go +++ b/pkg/ui/pages/repo/files.go @@ -142,6 +142,8 @@ func (f *Files) ShortHelp() []key.Binding { f.common.KeyMap.BackItem, } return b + case filesViewLoading: + return []key.Binding{} default: return []key.Binding{} } @@ -200,6 +202,8 @@ func (f *Files) FullHelp() [][]key.Binding { f.common.KeyMap.GotoBottom, }, }...) + case filesViewLoading: + // No help keys when loading } actionKeys = append([]key.Binding{ copyKey, diff --git a/pkg/web/git.go b/pkg/web/git.go index 50873cbc634b543b77e7915fcafe80afa8f619dd..6ed16ee625955095a3ed65f4ccbdddfe88ab17ce 100644 --- a/pkg/web/git.go +++ b/pkg/web/git.go @@ -399,6 +399,8 @@ func serviceRpc(w http.ResponseWriter, r *http.Request) { switch service { case git.UploadPackService, git.ReceivePackService: cmd.Args = append(cmd.Args, "--stateless-rpc") + case git.UploadArchiveService, git.LFSTransferService: + // No additional arguments needed for these services } user := proto.UserFromContext(ctx)