Class UnifiedDiffs
java.lang.Object
io.github.jbastgen.stemma.git.api.UnifiedDiffs
Helpers shared by the backends to produce the
FileDiff.hunks() format.-
Method Summary
Modifier and TypeMethodDescriptionstatic StringThe diff of a new text file: every line added.static StringReduces the output of a diff command to the hunks: drops everything before the first@@line (thediff --git,index,---and+++header) and all\ No newline at end of filemarkers.static booleanlooksBinary(byte[] content) Whether the content looks binary: a NUL byte within the first 8000 bytes, like git decides.
-
Method Details
-
hunksOnly
Reduces the output of a diff command to the hunks: drops everything before the first@@line (thediff --git,index,---and+++header) and all\ No newline at end of filemarkers. Lines are joined by\nwithout a trailing newline. -
allAdded
The diff of a new text file: every line added. An empty file has no hunks. -
looksBinary
public static boolean looksBinary(byte[] content) Whether the content looks binary: a NUL byte within the first 8000 bytes, like git decides.
-