One file's change between the before and after trees.
path is always the path that is meaningful after the change: the new
path for renames and copies, and the old path for deletions (so that
refute_removed/2 can match on it). old_path is set for renames and
copies only.
Summary
Functions
The path of this file in the after tree, or nil for deletions.
The path of this file in the before tree, or nil for additions.
Builds a change record by diffing the file's contents in the two trees.
Files larger than this (in either version) are not line-diffed.
Types
@type status() :: :added | :modified | :deleted | :renamed | :copied | :type_changed
@type t() :: %Presubmit.FileChange{ additions: non_neg_integer(), binary?: boolean(), deletions: non_neg_integer(), diffed?: boolean(), hunks: [Presubmit.Hunk.t()], old_path: String.t() | nil, path: String.t(), similarity: non_neg_integer() | nil, status: status() }
Functions
The path of this file in the after tree, or nil for deletions.
The path of this file in the before tree, or nil for additions.
@spec build( status(), String.t(), String.t() | nil, Presubmit.Tree.t(), Presubmit.Tree.t(), keyword() ) :: t()
Builds a change record by diffing the file's contents in the two trees.
Binary files (those containing a NUL byte, git's own heuristic) get no
hunks and zero line counts, and so do files over max_diff_bytes/0 in
either version, whose line diff would be too expensive; those are marked
diffed?: false.
@spec max_diff_bytes() :: pos_integer()
Files larger than this (in either version) are not line-diffed.