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

+2 -2
View File
@@ -46,7 +46,7 @@ func (d *Detector) DetectGit(cmd *sources.GitCmd, remote *RemoteInfo) ([]report.
}
}
if IsArchive(gitdiffFile.NewName) {
if isArchive(gitdiffFile.NewName) {
// Check if commit is allowed
d.Sema.Go(func() error {
// Check out the archive blob to disk
@@ -57,7 +57,7 @@ func (d *Detector) DetectGit(cmd *sources.GitCmd, remote *RemoteInfo) ([]report.
}
defer os.Remove(archivePath)
targets, tmpDir, err := ExtractArchive(archivePath)
targets, tmpDir, err := extractArchive(archivePath)
if err != nil {
os.RemoveAll(tmpDir)
logging.Warn().Err(err).Msg("failed to extract archive")