mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-29 12:44:22 +01:00
one tmp dir to rule them all, I think
This commit is contained in:
1 parent
56e409d9f1
commit
e0ea9cefde
7 files changed
+58
-41
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user