Skip to content

Latest commit

 

History

History
212 lines (163 loc) · 6.42 KB

File metadata and controls

212 lines (163 loc) · 6.42 KB
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

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.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
Returns
DiffDelta The filename of the match

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);
Parameters Type
m PathspecMatchList The git_pathspec_match_list object
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);
Parameters Type
m PathspecMatchList The git_pathspec_match_list object
Returns
Number Number of items in original pathspec that had no matches

Pathspec#free Sync

pathspec.free();

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 |