Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/smanonr..../opt/imh-pyth.../include/git2
File: pathspec.h
/*
[0] Fix | Delete
* Copyright (C) the libgit2 contributors. All rights reserved.
[1] Fix | Delete
*
[2] Fix | Delete
* This file is part of libgit2, distributed under the GNU GPL v2 with
[3] Fix | Delete
* a Linking Exception. For full terms see the included COPYING file.
[4] Fix | Delete
*/
[5] Fix | Delete
#ifndef INCLUDE_git_pathspec_h__
[6] Fix | Delete
#define INCLUDE_git_pathspec_h__
[7] Fix | Delete
[8] Fix | Delete
#include "common.h"
[9] Fix | Delete
#include "types.h"
[10] Fix | Delete
#include "strarray.h"
[11] Fix | Delete
#include "diff.h"
[12] Fix | Delete
[13] Fix | Delete
GIT_BEGIN_DECL
[14] Fix | Delete
[15] Fix | Delete
/**
[16] Fix | Delete
* Compiled pathspec
[17] Fix | Delete
*/
[18] Fix | Delete
typedef struct git_pathspec git_pathspec;
[19] Fix | Delete
[20] Fix | Delete
/**
[21] Fix | Delete
* List of filenames matching a pathspec
[22] Fix | Delete
*/
[23] Fix | Delete
typedef struct git_pathspec_match_list git_pathspec_match_list;
[24] Fix | Delete
[25] Fix | Delete
/**
[26] Fix | Delete
* Options controlling how pathspec match should be executed
[27] Fix | Delete
*/
[28] Fix | Delete
typedef enum {
[29] Fix | Delete
GIT_PATHSPEC_DEFAULT = 0,
[30] Fix | Delete
[31] Fix | Delete
/**
[32] Fix | Delete
* GIT_PATHSPEC_IGNORE_CASE forces match to ignore case; otherwise
[33] Fix | Delete
* match will use native case sensitivity of platform filesystem
[34] Fix | Delete
*/
[35] Fix | Delete
GIT_PATHSPEC_IGNORE_CASE = (1u << 0),
[36] Fix | Delete
[37] Fix | Delete
/**
[38] Fix | Delete
* GIT_PATHSPEC_USE_CASE forces case sensitive match; otherwise
[39] Fix | Delete
* match will use native case sensitivity of platform filesystem
[40] Fix | Delete
*/
[41] Fix | Delete
GIT_PATHSPEC_USE_CASE = (1u << 1),
[42] Fix | Delete
[43] Fix | Delete
/**
[44] Fix | Delete
* GIT_PATHSPEC_NO_GLOB disables glob patterns and just uses simple
[45] Fix | Delete
* string comparison for matching
[46] Fix | Delete
*/
[47] Fix | Delete
GIT_PATHSPEC_NO_GLOB = (1u << 2),
[48] Fix | Delete
[49] Fix | Delete
/**
[50] Fix | Delete
* GIT_PATHSPEC_NO_MATCH_ERROR means the match functions return error
[51] Fix | Delete
* code GIT_ENOTFOUND if no matches are found; otherwise no matches is
[52] Fix | Delete
* still success (return 0) but `git_pathspec_match_list_entrycount`
[53] Fix | Delete
* will indicate 0 matches.
[54] Fix | Delete
*/
[55] Fix | Delete
GIT_PATHSPEC_NO_MATCH_ERROR = (1u << 3),
[56] Fix | Delete
[57] Fix | Delete
/**
[58] Fix | Delete
* GIT_PATHSPEC_FIND_FAILURES means that the `git_pathspec_match_list`
[59] Fix | Delete
* should track which patterns matched which files so that at the end of
[60] Fix | Delete
* the match we can identify patterns that did not match any files.
[61] Fix | Delete
*/
[62] Fix | Delete
GIT_PATHSPEC_FIND_FAILURES = (1u << 4),
[63] Fix | Delete
[64] Fix | Delete
/**
[65] Fix | Delete
* GIT_PATHSPEC_FAILURES_ONLY means that the `git_pathspec_match_list`
[66] Fix | Delete
* does not need to keep the actual matching filenames. Use this to
[67] Fix | Delete
* just test if there were any matches at all or in combination with
[68] Fix | Delete
* GIT_PATHSPEC_FIND_FAILURES to validate a pathspec.
[69] Fix | Delete
*/
[70] Fix | Delete
GIT_PATHSPEC_FAILURES_ONLY = (1u << 5),
[71] Fix | Delete
} git_pathspec_flag_t;
[72] Fix | Delete
[73] Fix | Delete
/**
[74] Fix | Delete
* Compile a pathspec
[75] Fix | Delete
*
[76] Fix | Delete
* @param out Output of the compiled pathspec
[77] Fix | Delete
* @param pathspec A git_strarray of the paths to match
[78] Fix | Delete
* @return 0 on success, <0 on failure
[79] Fix | Delete
*/
[80] Fix | Delete
GIT_EXTERN(int) git_pathspec_new(
[81] Fix | Delete
git_pathspec **out, const git_strarray *pathspec);
[82] Fix | Delete
[83] Fix | Delete
/**
[84] Fix | Delete
* Free a pathspec
[85] Fix | Delete
*
[86] Fix | Delete
* @param ps The compiled pathspec
[87] Fix | Delete
*/
[88] Fix | Delete
GIT_EXTERN(void) git_pathspec_free(git_pathspec *ps);
[89] Fix | Delete
[90] Fix | Delete
/**
[91] Fix | Delete
* Try to match a path against a pathspec
[92] Fix | Delete
*
[93] Fix | Delete
* Unlike most of the other pathspec matching functions, this will not
[94] Fix | Delete
* fall back on the native case-sensitivity for your platform. You must
[95] Fix | Delete
* explicitly pass flags to control case sensitivity or else this will
[96] Fix | Delete
* fall back on being case sensitive.
[97] Fix | Delete
*
[98] Fix | Delete
* @param ps The compiled pathspec
[99] Fix | Delete
* @param flags Combination of git_pathspec_flag_t options to control match
[100] Fix | Delete
* @param path The pathname to attempt to match
[101] Fix | Delete
* @return 1 is path matches spec, 0 if it does not
[102] Fix | Delete
*/
[103] Fix | Delete
GIT_EXTERN(int) git_pathspec_matches_path(
[104] Fix | Delete
const git_pathspec *ps, uint32_t flags, const char *path);
[105] Fix | Delete
[106] Fix | Delete
/**
[107] Fix | Delete
* Match a pathspec against the working directory of a repository.
[108] Fix | Delete
*
[109] Fix | Delete
* This matches the pathspec against the current files in the working
[110] Fix | Delete
* directory of the repository. It is an error to invoke this on a bare
[111] Fix | Delete
* repo. This handles git ignores (i.e. ignored files will not be
[112] Fix | Delete
* considered to match the `pathspec` unless the file is tracked in the
[113] Fix | Delete
* index).
[114] Fix | Delete
*
[115] Fix | Delete
* If `out` is not NULL, this returns a `git_patchspec_match_list`. That
[116] Fix | Delete
* contains the list of all matched filenames (unless you pass the
[117] Fix | Delete
* `GIT_PATHSPEC_FAILURES_ONLY` flag) and may also contain the list of
[118] Fix | Delete
* pathspecs with no match (if you used the `GIT_PATHSPEC_FIND_FAILURES`
[119] Fix | Delete
* flag). You must call `git_pathspec_match_list_free()` on this object.
[120] Fix | Delete
*
[121] Fix | Delete
* @param out Output list of matches; pass NULL to just get return value
[122] Fix | Delete
* @param repo The repository in which to match; bare repo is an error
[123] Fix | Delete
* @param flags Combination of git_pathspec_flag_t options to control match
[124] Fix | Delete
* @param ps Pathspec to be matched
[125] Fix | Delete
* @return 0 on success, -1 on error, GIT_ENOTFOUND if no matches and
[126] Fix | Delete
* the GIT_PATHSPEC_NO_MATCH_ERROR flag was given
[127] Fix | Delete
*/
[128] Fix | Delete
GIT_EXTERN(int) git_pathspec_match_workdir(
[129] Fix | Delete
git_pathspec_match_list **out,
[130] Fix | Delete
git_repository *repo,
[131] Fix | Delete
uint32_t flags,
[132] Fix | Delete
git_pathspec *ps);
[133] Fix | Delete
[134] Fix | Delete
/**
[135] Fix | Delete
* Match a pathspec against entries in an index.
[136] Fix | Delete
*
[137] Fix | Delete
* This matches the pathspec against the files in the repository index.
[138] Fix | Delete
*
[139] Fix | Delete
* NOTE: At the moment, the case sensitivity of this match is controlled
[140] Fix | Delete
* by the current case-sensitivity of the index object itself and the
[141] Fix | Delete
* USE_CASE and IGNORE_CASE flags will have no effect. This behavior will
[142] Fix | Delete
* be corrected in a future release.
[143] Fix | Delete
*
[144] Fix | Delete
* If `out` is not NULL, this returns a `git_patchspec_match_list`. That
[145] Fix | Delete
* contains the list of all matched filenames (unless you pass the
[146] Fix | Delete
* `GIT_PATHSPEC_FAILURES_ONLY` flag) and may also contain the list of
[147] Fix | Delete
* pathspecs with no match (if you used the `GIT_PATHSPEC_FIND_FAILURES`
[148] Fix | Delete
* flag). You must call `git_pathspec_match_list_free()` on this object.
[149] Fix | Delete
*
[150] Fix | Delete
* @param out Output list of matches; pass NULL to just get return value
[151] Fix | Delete
* @param index The index to match against
[152] Fix | Delete
* @param flags Combination of git_pathspec_flag_t options to control match
[153] Fix | Delete
* @param ps Pathspec to be matched
[154] Fix | Delete
* @return 0 on success, -1 on error, GIT_ENOTFOUND if no matches and
[155] Fix | Delete
* the GIT_PATHSPEC_NO_MATCH_ERROR flag is used
[156] Fix | Delete
*/
[157] Fix | Delete
GIT_EXTERN(int) git_pathspec_match_index(
[158] Fix | Delete
git_pathspec_match_list **out,
[159] Fix | Delete
git_index *index,
[160] Fix | Delete
uint32_t flags,
[161] Fix | Delete
git_pathspec *ps);
[162] Fix | Delete
[163] Fix | Delete
/**
[164] Fix | Delete
* Match a pathspec against files in a tree.
[165] Fix | Delete
*
[166] Fix | Delete
* This matches the pathspec against the files in the given tree.
[167] Fix | Delete
*
[168] Fix | Delete
* If `out` is not NULL, this returns a `git_patchspec_match_list`. That
[169] Fix | Delete
* contains the list of all matched filenames (unless you pass the
[170] Fix | Delete
* `GIT_PATHSPEC_FAILURES_ONLY` flag) and may also contain the list of
[171] Fix | Delete
* pathspecs with no match (if you used the `GIT_PATHSPEC_FIND_FAILURES`
[172] Fix | Delete
* flag). You must call `git_pathspec_match_list_free()` on this object.
[173] Fix | Delete
*
[174] Fix | Delete
* @param out Output list of matches; pass NULL to just get return value
[175] Fix | Delete
* @param tree The root-level tree to match against
[176] Fix | Delete
* @param flags Combination of git_pathspec_flag_t options to control match
[177] Fix | Delete
* @param ps Pathspec to be matched
[178] Fix | Delete
* @return 0 on success, -1 on error, GIT_ENOTFOUND if no matches and
[179] Fix | Delete
* the GIT_PATHSPEC_NO_MATCH_ERROR flag is used
[180] Fix | Delete
*/
[181] Fix | Delete
GIT_EXTERN(int) git_pathspec_match_tree(
[182] Fix | Delete
git_pathspec_match_list **out,
[183] Fix | Delete
git_tree *tree,
[184] Fix | Delete
uint32_t flags,
[185] Fix | Delete
git_pathspec *ps);
[186] Fix | Delete
[187] Fix | Delete
/**
[188] Fix | Delete
* Match a pathspec against files in a diff list.
[189] Fix | Delete
*
[190] Fix | Delete
* This matches the pathspec against the files in the given diff list.
[191] Fix | Delete
*
[192] Fix | Delete
* If `out` is not NULL, this returns a `git_patchspec_match_list`. That
[193] Fix | Delete
* contains the list of all matched filenames (unless you pass the
[194] Fix | Delete
* `GIT_PATHSPEC_FAILURES_ONLY` flag) and may also contain the list of
[195] Fix | Delete
* pathspecs with no match (if you used the `GIT_PATHSPEC_FIND_FAILURES`
[196] Fix | Delete
* flag). You must call `git_pathspec_match_list_free()` on this object.
[197] Fix | Delete
*
[198] Fix | Delete
* @param out Output list of matches; pass NULL to just get return value
[199] Fix | Delete
* @param diff A generated diff list
[200] Fix | Delete
* @param flags Combination of git_pathspec_flag_t options to control match
[201] Fix | Delete
* @param ps Pathspec to be matched
[202] Fix | Delete
* @return 0 on success, -1 on error, GIT_ENOTFOUND if no matches and
[203] Fix | Delete
* the GIT_PATHSPEC_NO_MATCH_ERROR flag is used
[204] Fix | Delete
*/
[205] Fix | Delete
GIT_EXTERN(int) git_pathspec_match_diff(
[206] Fix | Delete
git_pathspec_match_list **out,
[207] Fix | Delete
git_diff *diff,
[208] Fix | Delete
uint32_t flags,
[209] Fix | Delete
git_pathspec *ps);
[210] Fix | Delete
[211] Fix | Delete
/**
[212] Fix | Delete
* Free memory associates with a git_pathspec_match_list
[213] Fix | Delete
*
[214] Fix | Delete
* @param m The git_pathspec_match_list to be freed
[215] Fix | Delete
*/
[216] Fix | Delete
GIT_EXTERN(void) git_pathspec_match_list_free(git_pathspec_match_list *m);
[217] Fix | Delete
[218] Fix | Delete
/**
[219] Fix | Delete
* Get the number of items in a match list.
[220] Fix | Delete
*
[221] Fix | Delete
* @param m The git_pathspec_match_list object
[222] Fix | Delete
* @return Number of items in match list
[223] Fix | Delete
*/
[224] Fix | Delete
GIT_EXTERN(size_t) git_pathspec_match_list_entrycount(
[225] Fix | Delete
const git_pathspec_match_list *m);
[226] Fix | Delete
[227] Fix | Delete
/**
[228] Fix | Delete
* Get a matching filename by position.
[229] Fix | Delete
*
[230] Fix | Delete
* This routine cannot be used if the match list was generated by
[231] Fix | Delete
* `git_pathspec_match_diff`. If so, it will always return NULL.
[232] Fix | Delete
*
[233] Fix | Delete
* @param m The git_pathspec_match_list object
[234] Fix | Delete
* @param pos The index into the list
[235] Fix | Delete
* @return The filename of the match
[236] Fix | Delete
*/
[237] Fix | Delete
GIT_EXTERN(const char *) git_pathspec_match_list_entry(
[238] Fix | Delete
const git_pathspec_match_list *m, size_t pos);
[239] Fix | Delete
[240] Fix | Delete
/**
[241] Fix | Delete
* Get a matching diff delta by position.
[242] Fix | Delete
*
[243] Fix | Delete
* This routine can only be used if the match list was generated by
[244] Fix | Delete
* `git_pathspec_match_diff`. Otherwise it will always return NULL.
[245] Fix | Delete
*
[246] Fix | Delete
* @param m The git_pathspec_match_list object
[247] Fix | Delete
* @param pos The index into the list
[248] Fix | Delete
* @return The filename of the match
[249] Fix | Delete
*/
[250] Fix | Delete
GIT_EXTERN(const git_diff_delta *) git_pathspec_match_list_diff_entry(
[251] Fix | Delete
const git_pathspec_match_list *m, size_t pos);
[252] Fix | Delete
[253] Fix | Delete
/**
[254] Fix | Delete
* Get the number of pathspec items that did not match.
[255] Fix | Delete
*
[256] Fix | Delete
* This will be zero unless you passed GIT_PATHSPEC_FIND_FAILURES when
[257] Fix | Delete
* generating the git_pathspec_match_list.
[258] Fix | Delete
*
[259] Fix | Delete
* @param m The git_pathspec_match_list object
[260] Fix | Delete
* @return Number of items in original pathspec that had no matches
[261] Fix | Delete
*/
[262] Fix | Delete
GIT_EXTERN(size_t) git_pathspec_match_list_failed_entrycount(
[263] Fix | Delete
const git_pathspec_match_list *m);
[264] Fix | Delete
[265] Fix | Delete
/**
[266] Fix | Delete
* Get an original pathspec string that had no matches.
[267] Fix | Delete
*
[268] Fix | Delete
* This will be return NULL for positions out of range.
[269] Fix | Delete
*
[270] Fix | Delete
* @param m The git_pathspec_match_list object
[271] Fix | Delete
* @param pos The index into the failed items
[272] Fix | Delete
* @return The pathspec pattern that didn't match anything
[273] Fix | Delete
*/
[274] Fix | Delete
GIT_EXTERN(const char *) git_pathspec_match_list_failed_entry(
[275] Fix | Delete
const git_pathspec_match_list *m, size_t pos);
[276] Fix | Delete
[277] Fix | Delete
GIT_END_DECL
[278] Fix | Delete
#endif
[279] Fix | Delete
[280] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function