fix(AIENG-359): Improve text detection by using ByteBuffer and charse…#1318
Open
psakthivel04 wants to merge 4 commits into
Open
fix(AIENG-359): Improve text detection by using ByteBuffer and charse…#1318psakthivel04 wants to merge 4 commits into
psakthivel04 wants to merge 4 commits into
Conversation
Contributor
|
This change sounds nice however we need to fix this change not only the smart-tests-cli command (v2) but also the launchable command (v1), right? Also when you update the Java code, please run |
c8d9515 to
771e9ae
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates the logic for detecting whether a file is text or binary in the
GitFileclass and adds comprehensive tests to ensure correctness. The main change replaces the previous character-based reading approach with a more robust UTF-8 decoder, and new unit tests are introduced to cover various scenarios.Improvements to text/binary file detection:
isText()method inGitFilenow uses a UTF-8 decoder with strict error reporting to determine if file content is valid UTF-8, making detection of binary files more accurate and efficient.Testing enhancements:
GitFileTestwith unit tests forisText(), covering text files, binary files, and multi-byte UTF-8 content.GitFileTestin theAllTestssuite to ensure it is run with other tests.Code cleanup:
GitFile.javato support the new decoding logic.