forked from trufflesecurity/trufflehog
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix binary handling (trufflesecurity#1999)
- Loading branch information
Showing
2 changed files
with
27 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -759,6 +759,10 @@ func TestStagedDiffParsing(t *testing.T) { | |
Content: *bytes.NewBuffer([]byte("/**\n * This is usually used for command mode applications with a startup logic. The logic is executed inside\n * {@link QuarkusApplication#run} method before the main application exits.\n */\n")), | ||
IsBinary: false, | ||
}, | ||
{ | ||
PathB: "trufflehog_3.42.0_linux_arm64.tar.gz", | ||
IsBinary: true, | ||
}, | ||
{ | ||
PathB: "tzu", | ||
LineStart: 11, | ||
|
@@ -813,7 +817,7 @@ func TestStagedDiffParsing(t *testing.T) { | |
} | ||
|
||
if !commit.Equal(&expected[i]) { | ||
t.Errorf("Commit does not match.\nexpected: %+v\n\nactual : %+v\n", expected[i], commit) | ||
t.Errorf("Commit does not match.\nexpected:\n%+v\n\nactual:\n%+v\n", expected[i], commit) | ||
} | ||
i++ | ||
} | ||
|
@@ -1715,14 +1719,24 @@ protos: | |
Author: "John Smith <[email protected]>", | ||
Date: newTime("Mon Jul 10 12:21:33 2023 -0400"), | ||
Message: newStringBuilderValue("Change binary file\n"), | ||
Diffs: []Diff{}, | ||
Diffs: []Diff{ | ||
{ | ||
PathB: "trufflehog_3.42.0_linux_arm64.tar.gz", | ||
IsBinary: true, | ||
}, | ||
}, | ||
}, | ||
{ | ||
Hash: "638595917417c5c8a956937b28c5127719023363", | ||
Author: "John Smith <[email protected]>", | ||
Date: newTime("Mon Jul 10 12:20:35 2023 -0400"), | ||
Message: newStringBuilderValue("Add binary file\n"), | ||
Diffs: []Diff{}, | ||
Diffs: []Diff{ | ||
{ | ||
PathB: "trufflehog_3.42.0_linux_arm64.tar.gz", | ||
IsBinary: true, | ||
}, | ||
}, | ||
}, | ||
{ | ||
Hash: "ce0f5d1fe0272f180ccb660196f439c0c2f4ec8e", | ||
|