Class Patch


  • public final class Patch
    extends Object
    Wrapper class for patch related aspects. Originally, this class represented a single modified file in a PatchSet. It's only kept in its current form as Patch.ChangeType and Patch.PatchType are used in diff cache entries for which we would break the serialization if we moved the enums somewhere else.
    • Field Detail

      • COMMIT_MSG

        public static final String COMMIT_MSG
        Magical file name which represents the commit message.
        See Also:
        Constant Field Values
      • MERGE_LIST

        public static final String MERGE_LIST
        Magical file name which represents the merge list of a merge commit.
        See Also:
        Constant Field Values
    • Method Detail

      • isMagic

        public static boolean isMagic​(String path)
        Checks if the given path represents a magic file. A magic file is a generated file that is automatically included into changes. It does not exist in the commit of the patch set.
        Parameters:
        path - the file path
        Returns:
        true if the path represents a magic file, otherwise false.