Native line diff for Git working and staged file previews.
Package: git.diff
Reachable from entry: yes
index.mlasindex_api→ src/git/index.mlobjects.mlasobjects→ src/git/objects.mlstatus.mlasstatus_api→ src/git/status.mlstd/fs.mlasfs→../release_1_3_17_ml/std/fs.ml— external dependencystd/string.mlass→../release_1_3_17_ml/std/string.ml— external dependency
const DIFF_ERR = 9406Diff error code.
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. |
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. |
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. |