var filter = new Filter();
Filter.listContains
var result = Filter.listContains(filters, name);
| Parameters | Type | |
|---|---|---|
| filters | FilterList | A loaded git_filter_list (or NULL) |
| name | String | The name of the filter to query |
| Returns | |
|---|---|
| Number | 1 if the filter is in the list, 0 otherwise |
Filter.listStreamBlob
var result = Filter.listStreamBlob(filters, blob, target);
| Parameters | Type | |
|---|---|---|
| filters | FilterList | the list of filters to apply |
| blob | Blob | the blob to filter |
| target | Writestream | the stream into which the data will be written |
| Returns | |
|---|---|
| Number |
Filter.listStreamData
var result = Filter.listStreamData(filters, data, target);
| Parameters | Type | |
|---|---|---|
| filters | FilterList | the list of filters to apply |
| data | Buf | the buffer to filter |
| target | Writestream | the stream into which the data will be written |
| Returns | |
|---|---|
| Number |
Filter.listStreamFile
var result = Filter.listStreamFile(filters, repo, path, target);
| Parameters | Type | |
|---|---|---|
| filters | FilterList | the list of filters to apply |
| repo | Repository | the repository in which to perform the filtering |
| path | String | the path of the file to filter, a relative path will be taken as relative to the workdir |
| target | Writestream | the stream into which the data will be written |
| Returns | |
|---|---|
| Number |
Filter.load
Filter.load(repo, blob, path, mode, flags).then(function(filterList) {
// Use filterList
});
| Parameters | Type | |
|---|---|---|
| repo | Repository | Repository object that contains path |
| blob | Blob | The blob to which the filter will be applied (if known) |
| path | String | Relative path of the file to be filtered |
| mode | Number | Filtering direction (WT->ODB or ODB->WT) |
| flags | Number | Combination of git_filter_flag_t flags |
| Returns | |
|---|---|
| FilterList | Output newly created git_filter_list (or NULL) |
Filter#applyToBlob
filter.applyToBlob(blob).then(function(buf) {
// Use buf
});
| Parameters | Type | |
|---|---|---|
| blob | Blob | the blob to filter |
| Returns | |
|---|---|
| Buf | buffer into which to store the filtered file |
Filter#applyToData
filter.applyToData(in).then(function(buf) {
// Use buf
});
| Parameters | Type | |
|---|---|---|
| in | Buf | Buffer containing the data to filter |
| Returns | |
|---|---|
| Buf | Buffer to store the result of the filtering |
Filter#applyToFile
filter.applyToFile(repo, path).then(function(buf) {
// Use buf
});
| Parameters | Type | |
|---|---|---|
| repo | Repository | the repository in which to perform the filtering |
| path | String | the path of the file to filter, a relative path will be taken as relative to the workdir |
| Returns | |
|---|---|
| Buf | buffer into which to store the filtered file |
Filter.FLAG
| Flag | Value |
|---|---|
| Filter.FLAG.DEFAULT | 0 |
| Filter.FLAG.ALLOW_UNSAFE | 1 |
| Filter.FLAG.NO_SYSTEM_ATTRIBUTES | 2 |
| Filter.FLAG.ATTRIBUTES_FROM_HEAD | 4 |
Filter.MODE
| Flag | Value |
|---|---|
| Filter.MODE.TO_WORKTREE | 0 |
| Filter.MODE.SMUDGE | 0 |
| Filter.MODE.TO_ODB | 1 |
| Filter.MODE.CLEAN | 1 |
Instance Variables
| Variable | Type | Description |
|---|---|---|
| apply | FilterApplyFn | |
| attributes | String | |
| check | FilterCheckFn | |
| cleanup | FilterCleanupFn | |
| initialize | FilterInitFn | |
| shutdown | FilterShutdownFn | |
| version | Number |