Diff.blobToBuffer Async
Diff.blobToBuffer(old_blob, old_as_path, buffer, buffer_as_path, opts, file_cb, binary_cb, hunk_cb, line_cb).then(function() {
// method complete});
Directly run a diff between a blob and a buffer.
| Parameters |
Type |
|
| old_blob |
Blob |
Blob for old side of diff, or NULL for empty blob |
| old_as_path |
String |
Treat old blob as if it had this filename; can be NULL |
| buffer |
String |
Raw data for new side of diff, or NULL for empty |
| buffer_as_path |
String |
Treat buffer as if it had this filename; can be NULL |
| opts |
DiffOptions |
Options for diff, or NULL for default options |
| file_cb |
Function |
Callback for “file”; made once if there is a diff; can be NULL |
| binary_cb |
Function |
Callback for binary files; can be NULL |
| hunk_cb |
Function |
Callback for each hunk in diff; can be NULL |
| line_cb |
Function |
Callback for each line in diff; can be NULL |
Diff.fromBuffer Async
Diff.fromBuffer(content, content_len).then(function(diff) {
// Use diff
});
| Parameters |
Type |
|
| content |
String |
The contents of a patch file |
| content_len |
Number |
The length of the patch file contents |
Diff.indexToIndex Async
Diff.indexToIndex(repo, old_index, new_index, opts).then(function(diff) {
// Use diff
});
| Parameters |
Type |
|
| repo |
Repository |
The repository containing the indexes. |
| old_index |
Index |
A git_index object to diff from. |
| new_index |
Index |
A git_index object to diff to. |
| opts |
DiffOptions |
Structure with options to influence diff or NULL for defaults. |
Diff.indexToWorkdir Async
Diff.indexToWorkdir(repo, index, opts).then(function(diff) {
// Use diff
});
| Parameters |
Type |
|
| repo |
Repository |
The repository. |
| index |
Index |
The index to diff from; repo index used if NULL. |
| opts |
DiffOptions |
Structure with options to influence diff or NULL for defaults. |
Diff.treeToIndex Async
Diff.treeToIndex(repo, old_tree, index, opts).then(function(diff) {
// Use diff
});
| Parameters |
Type |
|
| repo |
Repository |
The repository containing the tree and index. |
| old_tree |
Tree |
A git_tree object to diff from, or NULL for empty tree. |
| index |
Index |
The index to diff with; repo index used if NULL. |
| opts |
DiffOptions |
Structure with options to influence diff or NULL for defaults. |