one tmp dir to rule them all, I think

This commit is contained in:
Zach committed 2025-05-13 21:39:09 -05:00
1 parent 56e409d9f1
commit e0ea9cefde
7 files changed
+58 -41

No files matched your search

+1
View File
@@ -141,6 +141,7 @@ func NewGitDiffCmd(source string, staged bool) (*GitCmd, error) {
func (g *GitCmd) CheckoutBlob(commit, filepathInRepo string) (string, error) {
// Create a temp file with the same extension as the blob, if possible
ext := filepath.Ext(filepathInRepo)
// tmpDir, err := os.MkdirTemp("gitleaks", "archive-*")
tmpFile, err := os.CreateTemp("", "gitleaks-blob-*"+ext)
if err != nil {
return "", fmt.Errorf("creating temp file for blob: %w", err)