Skip to main content

Module diff_source

Module diff_source 

Source
Expand description

Read a unified diff and place it under the directory its paths are relative to, or say why the run cannot.

The CLI (--diff-file, --diff-stdin, $FALLOW_DIFF_FILE) and the programmatic API (a diff inherited from FALLOW_DIFF_FILE) both call these functions. A diff that one surface stands down on therefore stands down on the other with the same reason token and the same sentence, which is what request_outcomes["diff-filter"] publishes on both.

Structs§

DiffStandDown
Why a supplied diff could not be applied, plus the sentence that says so.

Functions§

diff_base_candidates
Directories a supplied unified diff’s paths might be relative to, most preferred first: the git toplevel above root, then root itself. Only root outside a git repository or when root is the toplevel.
place_diff
Place a parsed diff under the directory its paths are relative to.
read_diff_file
Read a diff file as UTF-8 text, within MAX_DIFF_BYTES.
read_diff_text
Read a diff from reader, up to limit bytes, as UTF-8 text.