On this page:
git_  pathspec_  free
git_  pathspec_  match_  diff
git_  pathspec_  match_  index
git_  pathspec_  match_  list_  diff_  entry
git_  pathspec_  match_  list_  entry
git_  pathspec_  match_  list_  entrycount
git_  pathspec_  match_  list_  failed_  entry
git_  pathspec_  match_  list_  failed_  entrycount
git_  pathspec_  match_  list_  free
git_  pathspec_  match_  tree
git_  pathspec_  match_  workdir
git_  pathspec_  matches_  path
git_  pathspec_  new
8.12

28 Pathspec🔗ℹ

 (require libgit2/include/pathspec) package: libgit2

procedure

(git_pathspec_free ps)  void?

  ps : pathspec?
Free a pathspec

procedure

(git_pathspec_match_diff diff flags ps)  pathspec_match_list?

  diff : diff?
  flags : git_pathspec_flag_t
  ps : pathspec?
Match a pathspec against files in a diff list.

This matches the pathspec against the files in the given diff list.

If out is not NULL, this returns a git_patchspec_match_list. That contains the list of all matched filenames (unless you pass the GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES flag). You must call git_pathspec_match_list_free() on this object.

procedure

(git_pathspec_match_index index flags ps)  pathspec_match_list?

  index : index?
  flags : git_pathspec_flag_t
  ps : pathspec?
Match a pathspec against entries in an index.

This matches the pathspec against the files in the repository index.

NOTE: At the moment, the case sensitivity of this match is controlled by the current case-sensitivity of the index object itself and the USE_CASE and IGNORE_CASE flags will have no effect. This behavior will be corrected in a future release.

If out is not NULL, this returns a git_patchspec_match_list. That contains the list of all matched filenames (unless you pass the GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES flag). You must call git_pathspec_match_list_free() on this object.

procedure

(git_pathspec_match_list_diff_entry m pos)  git_diff_delta?

  m : pathspec_match_list?
  pos : integer?
Get a matching diff delta by position.

This routine can only be used if the match list was generated by git_pathspec_match_diff. Otherwise it will always return NULL.

procedure

(git_pathspec_match_list_entry m pos)  string?

  m : pathspec_match_list?
  pos : integer?
Get a matching filename by position.

This routine cannot be used if the match list was generated by git_pathspec_match_diff. If so, it will always return NULL.

procedure

(git_pathspec_match_list_entrycount m)  integer?

  m : pathspec_match_list?
Get the number of items in a match list.

procedure

(git_pathspec_match_list_failed_entry m    
  pos)  string?
  m : pathspec_match_list?
  pos : size_t
Get an original pathspec string that had no matches.

This will be return NULL for positions out of range.

procedure

(git_pathspec_match_list_failed_entrycount m)  integer?

  m : pathspec_match_list?
Get the number of pathspec items that did not match.

This will be zero unless you passed GIT_PATHSPEC_FIND_FAILURES when generating the git_pathspec_match_list.

procedure

(git_pathspec_match_list_free m)  void?

  m : pathspec_match_list?
Free memory associates with a git_pathspec_match_list

procedure

(git_pathspec_match_tree tree flags ps)  pathspec_match_list?

  tree : tree?
  flags : git_pathspec_flag_t
  ps : pathspec?
Match a pathspec against files in a tree.

This matches the pathspec against the files in the given tree.

If out is not NULL, this returns a git_patchspec_match_list. That contains the list of all matched filenames (unless you pass the GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES flag). You must call git_pathspec_match_list_free() on this object.

procedure

(git_pathspec_match_workdir repo flags ps)  pathspec_match_list?

  repo : repository?
  flags : git_pathspec_flag_t
  ps : pathspec?
Match a pathspec against the working directory of a repository.

This matches the pathspec against the current files in the working directory of the repository. It is an error to invoke this on a bare repo. This handles git ignores (i.e. ignored files will not be considered to match the pathspec unless the file is tracked in the index).

If out is not NULL, this returns a git_patchspec_match_list. That contains the list of all matched filenames (unless you pass the GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES flag). You must call git_pathspec_match_list_free() on this object.

procedure

(git_pathspec_matches_path ps flags path)  integer?

  ps : pathspec?
  flags : git_pathspec_flag_t
  path : string?
Try to match a path against a pathspec

Unlike most of the other pathspec matching functions, this will not fall back on the native case-sensitivity for your platform. You must explicitly pass flags to control case sensitivity or else this will fall back on being case sensitive.

procedure

(git_pathspec_new pathspec)  pathspec?

  pathspec : strarray?
Compile a pathspec