@@ -8,6 +8,7 @@ return_to:
8
8
" API Documentation Index " : /api/
9
9
sections :
10
10
" blobToBuffer " : " #blobToBuffer"
11
+ " fromBuffer " : " #fromBuffer"
11
12
" indexToIndex " : " #indexToIndex"
12
13
" indexToWorkdir " : " #indexToWorkdir"
13
14
" treeToIndex " : " #treeToIndex"
@@ -20,6 +21,7 @@ sections:
20
21
" #merge " : " #merge"
21
22
" #numDeltas " : " #numDeltas"
22
23
" #patches " : " #patches"
24
+ " #toBuf " : " #toBuf"
23
25
" DELTA " : " #DELTA"
24
26
" FIND " : " #FIND"
25
27
" FLAG " : " #FLAG"
@@ -51,6 +53,23 @@ Directly run a diff between a blob and a buffer.
51
53
| hunk_cb | Function | Callback for each hunk in diff; can be NULL |
52
54
| line_cb | Function | Callback for each line in diff; can be NULL |
53
55
56
+ ## <a name="fromBuffer"></a><span>Diff.</span>fromBuffer <span class="tags"><span class="async">Async</span></span>
57
+
58
+ ` ` ` js
59
+ Diff .fromBuffer (content, content_len).then (function (diff ) {
60
+ // Use diff
61
+ });
62
+ ` ` `
63
+
64
+ | Parameters | Type | |
65
+ | --- | --- | --- |
66
+ | content | String | The contents of a patch file |
67
+ | content_len | Number | The length of the patch file contents |
68
+
69
+ | Returns | |
70
+ | --- | --- |
71
+ | [Diff](/api/diff/) | |
72
+
54
73
## <a name="indexToIndex"></a><span>Diff.</span>indexToIndex <span class="tags"><span class="async">Async</span></span>
55
74
56
75
` ` ` js
@@ -244,6 +263,23 @@ Retrieve patches in this difflist
244
263
| --- | --- |
245
264
| Array<[ConvenientPatch](/api/convenient_patch/)> | a promise that resolves to an array of ConvenientPatches |
246
265
266
+ ## <a name="toBuf"></a><span>Diff#</span>toBuf <span class="tags"><span class="async">Async</span></span>
267
+
268
+ ` ` ` js
269
+ diff .toBuf (format).then (function (buf ) {
270
+ // Use buf
271
+ });
272
+ ` ` `
273
+
274
+ | Parameters | Type |
275
+ | --- | --- | --- |
276
+ | format | Number | A git_diff_format_t value to pick the text format. |
277
+
278
+ | Returns | |
279
+ | --- | --- |
280
+ | [Buf](/api/buf/) | a user-allocated git_buf that will
281
+ contain the diff text |
282
+
247
283
## <a name="DELTA"></a><span>Diff.</span>DELTA <span class="tags"><span class="enum">ENUM</span></span>
248
284
249
285
| Flag | Value |
0 commit comments