| layout |
default |
| menu_item |
api |
| title |
Pathspec |
| description |
Version 0.19.0 |
| return_to |
| API Documentation Index |
/api/ |
|
| sections |
| create |
matchListDiffEntry |
matchListEntry |
matchListEntrycount |
matchListFailedEntry |
matchListFailedEntrycount |
#free |
#matchDiff |
#matchIndex |
#matchTree |
#matchWorkdir |
#matchesPath |
FLAG |
#create |
#matchListDiffEntry |
#matchListEntry |
#matchListEntrycount |
#matchListFailedEntry |
#matchListFailedEntrycount |
#free |
#matchDiff |
#matchIndex |
#matchTree |
#matchWorkdir |
#matchesPath |
#FLAG |
|
var pathspec = Pathspec.create(pathspec);
| Parameters |
Type |
|
| pathspec |
Strarray |
A git_strarray of the paths to match |
| Returns |
|
| Pathspec |
Output of the compiled pathspec |
Pathspec.matchListDiffEntry Sync
var diffDelta = Pathspec.matchListDiffEntry(m, pos);
| Parameters |
Type |
|
| m |
PathspecMatchList |
The git_pathspec_match_list object |
| pos |
Number |
The index into the list |
Pathspec.matchListEntry Sync
var string = Pathspec.matchListEntry(m, pos);
| Parameters |
Type |
|
| m |
PathspecMatchList |
The git_pathspec_match_list object |
| pos |
Number |
The index into the list |
| Returns |
|
| String |
The filename of the match |
Pathspec.matchListEntrycount Sync
var result = Pathspec.matchListEntrycount(m);
| Returns |
|
| Number |
Number of items in match list |
Pathspec.matchListFailedEntry Sync
var string = Pathspec.matchListFailedEntry(m, pos);
| Parameters |
Type |
|
| m |
PathspecMatchList |
The git_pathspec_match_list object |
| pos |
Number |
The index into the failed items |
| Returns |
|
| String |
The pathspec pattern that didn't match anything |
Pathspec.matchListFailedEntrycount Sync
var result = Pathspec.matchListFailedEntrycount(m);
| Returns |
|
| Number |
Number of items in original pathspec that had no matches |
pathspec.matchDiff(diff, flags).then(function(pathspecMatchList) {
// Use pathspecMatchList
});
| Parameters | Type |
| --- | --- | --- |
| diff | Diff | A generated diff list |
| flags | Number | Combination of git_pathspec_flag_t options to control match |
Pathspec#matchIndex Async
pathspec.matchIndex(index, flags).then(function(pathspecMatchList) {
// Use pathspecMatchList
});
| Parameters | Type |
| --- | --- | --- |
| index | Index | The index to match against |
| flags | Number | Combination of git_pathspec_flag_t options to control match |
pathspec.matchTree(tree, flags).then(function(pathspecMatchList) {
// Use pathspecMatchList
});
| Parameters | Type |
| --- | --- | --- |
| tree | Tree | The root-level tree to match against |
| flags | Number | Combination of git_pathspec_flag_t options to control match |
Pathspec#matchWorkdir Async
pathspec.matchWorkdir(repo, flags).then(function(pathspecMatchList) {
// Use pathspecMatchList
});
| Parameters | Type |
| --- | --- | --- |
| repo | Repository | The repository in which to match; bare repo is an error |
| flags | Number | Combination of git_pathspec_flag_t options to control match |
Pathspec#matchesPath Sync
var result = pathspec.matchesPath(flags, path);
| Parameters | Type |
| --- | --- | --- |
| flags | Number | Combination of git_pathspec_flag_t options to control match |
| path | String | The pathname to attempt to match |
| Returns |
|
| Number |
1 is path matches spec, 0 if it does not |
| Flag | Value |
| --- | --- | --- |
| Pathspec.FLAG.DEFAULT | 0 |
| Pathspec.FLAG.IGNORE_CASE | 1 |
| Pathspec.FLAG.USE_CASE | 2 |
| Pathspec.FLAG.NO_GLOB | 4 |
| Pathspec.FLAG.NO_MATCH_ERROR | 8 |
| Pathspec.FLAG.FIND_FAILURES | 16 |
| Pathspec.FLAG.FAILURES_ONLY | 32 |