Pathspec.create Sync

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#matchDiff Async

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
Returns  
PathspecMatchList Output list of matches; pass NULL to just get return value

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
Returns  
PathspecMatchList Output list of matches; pass NULL to just get return value

Pathspec#matchTree Async

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
Returns  
PathspecMatchList Output list of matches; pass NULL to just get return value

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
Returns  
PathspecMatchList Output list of matches; pass NULL to just get return value

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

Pathspec.FLAG ENUM

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