Skip to content

Latest commit

 

History

History
84 lines (54 loc) · 2.42 KB

File-src-git-diff-ml-550465383.md

File metadata and controls

84 lines (54 loc) · 2.42 KB

src/git/diff.ml

Home · Files

Native line diff for Git working and staged file previews.

Package: git.diff

Reachable from entry: yes

Imports

  • index.ml as index_api → src/git/index.ml
  • objects.ml as objects → src/git/objects.ml
  • status.ml as status_api → src/git/status.ml
  • std/fs.ml as fs → ../release_1_3_17_ml/std/fs.ml — external dependency
  • std/string.ml as s → ../release_1_3_17_ml/std/string.ml — external dependency

Declarations

DIFF_ERR

const DIFF_ERR = 9406

Diff error code.

View source

render

function render(before, after, oldName, newName)

Build a readable line diff with the whole file as context.

Parameter Type Default Description
before dynamic — Previous file bytes.
after dynamic — New file bytes.
oldName dynamic — Previous label.
newName dynamic — New label.

View source

staged

function staged(repo, path)

Return a staged diff against the committed HEAD tree.

Parameter Type Default Description
repo dynamic — Open repository.
path dynamic — Repository-relative file.

View source

working

function working(repo, path)

Return a working-tree diff against the index.

Parameter Type Default Description
repo dynamic — Open repository.
path dynamic — Repository-relative file.

View source