Skip to content

Commit bff5819

Browse files
committed
Bump to 0.21.1
1 parent 4b480ba commit bff5819

File tree

18 files changed

+403
-146
lines changed

18 files changed

+403
-146
lines changed

api/blame/index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ sections:
1717
"FLAG": "#FLAG"
1818
---
1919

20-
## <a name="file"></a><span>Blame.</span>file <span class="tags"><span class="sync">Sync</span></span>
20+
## <a name="file"></a><span>Blame.</span>file <span class="tags"><span class="async">Async</span></span>
2121

2222
```js
23-
Blame.file(repo, path, [options]);
23+
Blame.file(repo, path, [options]).then(function() {
24+
// method complete});
2425
```
2526
2627
Retrieve the blame of a file

api/blob/index.md

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ sections:
1212
"createFromStream": "#createFromStream"
1313
"createFromWorkdir": "#createFromWorkdir"
1414
"createFromstreamCommit": "#createFromstreamCommit"
15+
"filteredContent": "#filteredContent"
1516
"lookup": "#lookup"
1617
"lookupPrefix": "#lookupPrefix"
1718
"#content": "#content"
@@ -26,10 +27,12 @@ sections:
2627
"#toString": "#toString"
2728
---
2829

29-
## <a name="createFromBuffer"></a><span>Blob.</span>createFromBuffer <span class="tags"><span class="sync">Sync</span></span>
30+
## <a name="createFromBuffer"></a><span>Blob.</span>createFromBuffer <span class="tags"><span class="async">Async</span></span>
3031

3132
```js
32-
var oid = Blob.createFromBuffer(repo, buffer, len);
33+
Blob.createFromBuffer(repo, buffer, len).then(function(oid) {
34+
// Use oid
35+
});
3336
```
3437

3538
| Parameters | Type | |
@@ -42,21 +45,22 @@ var oid = Blob.createFromBuffer(repo, buffer, len);
4245
| --- | --- |
4346
| [Oid](/api/oid/) | return the id of the written blob |
4447

45-
## <a name="createFromDisk"></a><span>Blob.</span>createFromDisk <span class="tags"><span class="sync">Sync</span></span>
48+
## <a name="createFromDisk"></a><span>Blob.</span>createFromDisk <span class="tags"><span class="async">Async</span></span>
4649

4750
```js
48-
var result = Blob.createFromDisk(id, repo, path);
51+
Blob.createFromDisk(repo, path).then(function(oid) {
52+
// Use oid
53+
});
4954
```
5055

5156
| Parameters | Type | |
5257
| --- | --- | --- |
53-
| id | [Oid](/api/oid/) | return the id of the written blob |
5458
| repo | [Repository](/api/repository/) | repository where the blob will be written. this repository can be bare or not |
5559
| path | String | file from which the blob will be created |
5660

5761
| Returns | |
5862
| --- | --- |
59-
| Number | 0 or an error code |
63+
| [Oid](/api/oid/) | return the id of the written blob |
6064

6165
## <a name="createFromStream"></a><span>Blob.</span>createFromStream <span class="tags"><span class="async">Async</span></span>
6266

@@ -75,21 +79,22 @@ Blob.createFromStream(repo, hintpath).then(function(writestream) {
7579
| --- | --- |
7680
| [Writestream](/api/writestream/) | the stream into which to write |
7781

78-
## <a name="createFromWorkdir"></a><span>Blob.</span>createFromWorkdir <span class="tags"><span class="sync">Sync</span></span>
82+
## <a name="createFromWorkdir"></a><span>Blob.</span>createFromWorkdir <span class="tags"><span class="async">Async</span></span>
7983

8084
```js
81-
var result = Blob.createFromWorkdir(id, repo, relative_path);
85+
Blob.createFromWorkdir(repo, relative_path).then(function(oid) {
86+
// Use oid
87+
});
8288
```
8389

8490
| Parameters | Type | |
8591
| --- | --- | --- |
86-
| id | [Oid](/api/oid/) | return the id of the written blob |
8792
| repo | [Repository](/api/repository/) | repository where the blob will be written. this repository cannot be bare |
8893
| relative_path | String | file from which the blob will be created, relative to the repository's working dir |
8994

9095
| Returns | |
9196
| --- | --- |
92-
| Number | 0 or an error code |
97+
| [Oid](/api/oid/) | return the id of the written blob |
9398

9499
## <a name="createFromstreamCommit"></a><span>Blob.</span>createFromstreamCommit <span class="tags"><span class="async">Async</span></span>
95100

@@ -107,6 +112,24 @@ Blob.createFromstreamCommit(stream).then(function(oid) {
107112
| --- | --- |
108113
| [Oid](/api/oid/) | the id of the new blob |
109114

115+
## <a name="filteredContent"></a><span>Blob.</span>filteredContent <span class="tags"><span class="async">Async</span></span>
116+
117+
```js
118+
Blob.filteredContent(blob, as_path, check_for_binary_data).then(function(buffer) {
119+
// Use buffer
120+
});
121+
```
122+
123+
| Parameters | Type | |
124+
| --- | --- | --- |
125+
| blob | [Blob](/api/blob/) | Pointer to the blob |
126+
| as_path | String | Path used for file attribute lookups, etc. |
127+
| check_for_binary_data | Number | Should this test if blob content contains NUL bytes / looks like binary data before applying filters? |
128+
129+
| Returns | |
130+
| --- | --- |
131+
| Buffer | The git_buf to be filled in |
132+
110133
## <a name="lookup"></a><span>Blob.</span>lookup <span class="tags"><span class="async">Async</span></span>
111134

112135
```js

api/branch/index.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ sections:
1515
"lookup": "#lookup"
1616
"move": "#move"
1717
"name": "#name"
18+
"remoteName": "#remoteName"
1819
"setUpstream": "#setUpstream"
1920
"upstream": "#upstream"
2021
"BRANCH": "#BRANCH"
@@ -156,6 +157,25 @@ Branch.name(ref).then(function(string) {
156157
| --- | --- |
157158
| String | |
158159

160+
## <a name="remoteName"></a><span>Branch.</span>remoteName <span class="tags"><span class="async">Async</span></span>
161+
162+
```js
163+
Branch.remoteName(repo, the).then(function(string) {
164+
// Use string
165+
});
166+
```
167+
168+
Retrieve the Branch's Remote Name as a String.
169+
170+
| Parameters | Type | |
171+
| --- | --- | --- |
172+
| repo | [Repository](/api/repository/) | The repo to get the remote name from |
173+
| the | String | refname of the branch |
174+
175+
| Returns | |
176+
| --- | --- |
177+
| String | remote name as a string. |
178+
159179
## <a name="setUpstream"></a><span>Branch.</span>setUpstream <span class="tags"><span class="async">Async</span></span>
160180

161181
```js

api/buf/index.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ buf.free();
3434
## <a name="grow"></a><span>Buf#</span>grow <span class="tags"><span class="async">Async</span><span class="experimental">Experimental</span></span>
3535

3636
```js
37-
buf.grow(target_size).then(function(buf) {
38-
// Use buf
37+
buf.grow(target_size).then(function(result) {
38+
// Use result
3939
});
4040
```
4141

@@ -45,7 +45,7 @@ buf.grow(target_size).then(function(buf) {
4545

4646
| Returns | |
4747
| --- | --- |
48-
| [Buf](/api/buf/) | The buffer to be resized; may or may not be allocated yet |
48+
| Number | 0 on success, -1 on allocation failure |
4949

5050
## <a name="isBinary"></a><span>Buf#</span>isBinary <span class="tags"><span class="sync">Sync</span><span class="experimental">Experimental</span></span>
5151

@@ -60,8 +60,8 @@ var result = buf.isBinary();
6060
## <a name="set"></a><span>Buf#</span>set <span class="tags"><span class="async">Async</span><span class="experimental">Experimental</span></span>
6161

6262
```js
63-
buf.set(data, datalen).then(function(buf) {
64-
// Use buf
63+
buf.set(data, datalen).then(function(result) {
64+
// Use result
6565
});
6666
```
6767

@@ -72,7 +72,7 @@ buf.set(data, datalen).then(function(buf) {
7272

7373
| Returns | |
7474
| --- | --- |
75-
| [Buf](/api/buf/) | The buffer to set |
75+
| Number | 0 on success, -1 on allocation failure |
7676

7777
## <a name="ivars"></a>Instance Variables
7878

api/filter/index.md

Lines changed: 60 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,24 @@ return_to:
99
sections:
1010
"listContains": "#listContains"
1111
"listLength": "#listLength"
12-
"listNew": "#listNew"
13-
"listStreamBlob": "#listStreamBlob"
14-
"listStreamData": "#listStreamData"
15-
"listStreamFile": "#listStreamFile"
12+
"load": "#load"
1613
"unregister": "#unregister"
14+
"#applyToBlob": "#applyToBlob"
15+
"#applyToData": "#applyToData"
16+
"#applyToFile": "#applyToFile"
17+
"#free": "#free"
1718
"#lookup": "#lookup"
1819
"#register": "#register"
1920
"FLAG": "#FLAG"
2021
"MODE": "#MODE"
2122
"Instance Variables": "#ivars"
2223
---
2324

24-
## <a name="listContains"></a><span>Filter.</span>listContains <span class="tags"><span class="sync">Sync</span><span class="experimental">Experimental</span></span>
25+
```js
26+
var filter = new Filter();
27+
```
28+
29+
## <a name="listContains"></a><span>Filter.</span>listContains <span class="tags"><span class="sync">Sync</span></span>
2530

2631
```js
2732
var result = Filter.listContains(filters, name);
@@ -36,7 +41,7 @@ var result = Filter.listContains(filters, name);
3641
| --- | --- |
3742
| Number | 1 if the filter is in the list, 0 otherwise |
3843

39-
## <a name="listLength"></a><span>Filter.</span>listLength <span class="tags"><span class="sync">Sync</span><span class="experimental">Experimental</span></span>
44+
## <a name="listLength"></a><span>Filter.</span>listLength <span class="tags"><span class="sync">Sync</span></span>
4045

4146
```js
4247
var result = Filter.listLength(fl);
@@ -50,90 +55,98 @@ var result = Filter.listLength(fl);
5055
| --- | --- |
5156
| Number | The number of filters in the list |
5257

53-
## <a name="listNew"></a><span>Filter.</span>listNew <span class="tags"><span class="async">Async</span><span class="experimental">Experimental</span></span>
58+
## <a name="load"></a><span>Filter.</span>load <span class="tags"><span class="async">Async</span></span>
5459

5560
```js
56-
Filter.listNew(repo, mode, options).then(function(filterList) {
61+
Filter.load(repo, blob, path, mode, flags).then(function(filterList) {
5762
// Use filterList
5863
});
5964
```
6065

6166
| Parameters | Type | |
6267
| --- | --- | --- |
63-
| repo | [Repository](/api/repository/) | |
64-
| mode | Number | |
65-
| options | Number | |
68+
| repo | [Repository](/api/repository/) | Repository object that contains `path` |
69+
| blob | [Blob](/api/blob/) | The blob to which the filter will be applied (if known) |
70+
| path | String | Relative path of the file to be filtered |
71+
| mode | Number | Filtering direction (WT->ODB or ODB->WT) |
72+
| flags | Number | Combination of `git_filter_flag_t` flags |
6673

6774
| Returns | |
6875
| --- | --- |
69-
| [FilterList](/api/filter_list/) | |
76+
| [FilterList](/api/filter_list/) | Output newly created git_filter_list (or NULL) |
7077

71-
## <a name="listStreamBlob"></a><span>Filter.</span>listStreamBlob <span class="tags"><span class="sync">Sync</span><span class="experimental">Experimental</span></span>
78+
## <a name="unregister"></a><span>Filter.</span>unregister <span class="tags"><span class="sync">Sync</span></span>
7279

7380
```js
74-
var result = Filter.listStreamBlob(filters, blob, target);
81+
var result = Filter.unregister(name);
7582
```
7683

7784
| Parameters | Type | |
7885
| --- | --- | --- |
79-
| filters | [FilterList](/api/filter_list/) | the list of filters to apply |
80-
| blob | [Blob](/api/blob/) | the blob to filter |
81-
| target | [Writestream](/api/writestream/) | the stream into which the data will be written |
86+
| name | String | The name under which the filter was registered |
8287

8388
| Returns | |
8489
| --- | --- |
85-
| Number | |
90+
| Number | 0 on success, error code
91+
<
92+
0 on failure |
8693

87-
## <a name="listStreamData"></a><span>Filter.</span>listStreamData <span class="tags"><span class="sync">Sync</span><span class="experimental">Experimental</span></span>
94+
## <a name="applyToBlob"></a><span>Filter#</span>applyToBlob <span class="tags"><span class="async">Async</span></span>
8895

8996
```js
90-
var result = Filter.listStreamData(filters, data, target);
97+
filter.applyToBlob(blob).then(function(buf) {
98+
// Use buf
99+
});
91100
```
92101

93-
| Parameters | Type | |
102+
| Parameters | Type |
94103
| --- | --- | --- |
95-
| filters | [FilterList](/api/filter_list/) | the list of filters to apply |
96-
| data | [Buf](/api/buf/) | the buffer to filter |
97-
| target | [Writestream](/api/writestream/) | the stream into which the data will be written |
104+
| blob | [Blob](/api/blob/) | the blob to filter |
98105

99106
| Returns | |
100107
| --- | --- |
101-
| Number | |
108+
| [Buf](/api/buf/) | buffer into which to store the filtered file |
102109

103-
## <a name="listStreamFile"></a><span>Filter.</span>listStreamFile <span class="tags"><span class="sync">Sync</span><span class="experimental">Experimental</span></span>
110+
## <a name="applyToData"></a><span>Filter#</span>applyToData <span class="tags"><span class="async">Async</span></span>
104111

105112
```js
106-
var result = Filter.listStreamFile(filters, repo, path, target);
113+
filter.applyToData(in).then(function(buf) {
114+
// Use buf
115+
});
107116
```
108117

109-
| Parameters | Type | |
118+
| Parameters | Type |
110119
| --- | --- | --- |
111-
| filters | [FilterList](/api/filter_list/) | the list of filters to apply |
112-
| repo | [Repository](/api/repository/) | the repository in which to perform the filtering |
113-
| path | String | the path of the file to filter, a relative path will be taken as relative to the workdir |
114-
| target | [Writestream](/api/writestream/) | the stream into which the data will be written |
120+
| in | [Buf](/api/buf/) | Buffer containing the data to filter |
115121

116122
| Returns | |
117123
| --- | --- |
118-
| Number | |
124+
| [Buf](/api/buf/) | Buffer to store the result of the filtering |
119125

120-
## <a name="unregister"></a><span>Filter.</span>unregister <span class="tags"><span class="sync">Sync</span><span class="experimental">Experimental</span></span>
126+
## <a name="applyToFile"></a><span>Filter#</span>applyToFile <span class="tags"><span class="async">Async</span></span>
121127

122128
```js
123-
var result = Filter.unregister(name);
129+
filter.applyToFile(repo, path).then(function(buf) {
130+
// Use buf
131+
});
124132
```
125133

126-
| Parameters | Type | |
134+
| Parameters | Type |
127135
| --- | --- | --- |
128-
| name | String | The name under which the filter was registered |
136+
| repo | [Repository](/api/repository/) | the repository in which to perform the filtering |
137+
| path | String | the path of the file to filter, a relative path will be taken as relative to the workdir |
129138

130139
| Returns | |
131140
| --- | --- |
132-
| Number | 0 on success, error code
133-
<
134-
0 on failure |
141+
| [Buf](/api/buf/) | buffer into which to store the filtered file |
142+
143+
## <a name="free"></a><span>Filter#</span>free <span class="tags"><span class="sync">Sync</span></span>
144+
145+
```js
146+
filter.free();
147+
```
135148

136-
## <a name="lookup"></a><span>Filter#</span>lookup <span class="tags"><span class="sync">Sync</span><span class="experimental">Experimental</span></span>
149+
## <a name="lookup"></a><span>Filter#</span>lookup <span class="tags"><span class="sync">Sync</span></span>
137150

138151
```js
139152
var filter = filter.lookup(name);
@@ -147,7 +160,7 @@ var filter = filter.lookup(name);
147160
| --- | --- |
148161
| [Filter](/api/filter/) | |
149162

150-
## <a name="register"></a><span>Filter#</span>register <span class="tags"><span class="sync">Sync</span><span class="experimental">Experimental</span></span>
163+
## <a name="register"></a><span>Filter#</span>register <span class="tags"><span class="sync">Sync</span></span>
151164

152165
```js
153166
var result = filter.register(name, priority);
@@ -184,7 +197,11 @@ var result = filter.register(name, priority);
184197

185198
| Variable | Type | Description |
186199
| --- | --- | --- |
200+
| <a name="apply"></a>apply | FilterApplyFn | |
187201
| <a name="attributes"></a>attributes | String | |
188-
| <a name="stream"></a>stream | FilterStreamFn | |
202+
| <a name="check"></a>check | FilterCheckFn | |
203+
| <a name="cleanup"></a>cleanup | FilterCleanupFn | |
204+
| <a name="initialize"></a>initialize | FilterInitFn | |
205+
| <a name="shutdown"></a>shutdown | FilterShutdownFn | |
189206
| <a name="version"></a>version | Number | |
190207

0 commit comments

Comments
 (0)