From 49df8caf8233b762578c11dcb2802bfa48517436 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Wed, 24 Jun 2026 17:20:19 +0200 Subject: [PATCH] Create the custom-patch temp dir under lazygit's configured temp dir MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use osCommand.GetTempDir() (lazygit's own per-session temp dir, which it creates and cleans up) as the parent for the custom-patch diff trees, instead of the OS default — so it honors the configured temp dir and is cleaned up with the rest of lazygit's temp files. Co-Authored-By: Claude Opus 4.8 (1M context) --- pkg/commands/git.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/commands/git.go b/pkg/commands/git.go index a4cef9407..65392e607 100644 --- a/pkg/commands/git.go +++ b/pkg/commands/git.go @@ -139,7 +139,7 @@ func NewGitCommandAux( return workingTreeCommands.ShowFileDiff(from, to, reverse, filename, previousPath, plain) }, func() (string, error) { - return os.MkdirTemp("", "lazygit-custom-patch-") + return os.MkdirTemp(osCommand.GetTempDir(), "custom-patch-") }) patchCommands := git_commands.NewPatchCommands(gitCommon, rebaseCommands, commitCommands, statusCommands, stashCommands, patchBuilder) bisectCommands := git_commands.NewBisectCommands(gitCommon)