Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatheus Tavares <matheus.bernardino@usp.br>2021-04-08 23:41:25 +0300
committerJunio C Hamano <gitster@pobox.com>2021-04-09 00:18:03 +0300
commit719630eb4826ff7f36bc060533dbccc3c96d151c (patch)
tree56bf2c8141c856f5e926fbddaf48ad9df8658a85 /pathspec.h
parentd73dbafc2c25eb45090d6aa9d56fc21b40c78083 (diff)
pathspec: allow to ignore SKIP_WORKTREE entries on index matching
Add a new enum parameter to `add_pathspec_matches_against_index()` and `find_pathspecs_matching_against_index()`, allowing callers to specify whether these function should attempt to match SKIP_WORKTREE entries or not. This will be used in a future patch to make `git add` display a warning when it is asked to update SKIP_WORKTREE entries. Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pathspec.h')
-rw-r--r--pathspec.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/pathspec.h b/pathspec.h
index 454ce364fa..0feb8e9f67 100644
--- a/pathspec.h
+++ b/pathspec.h
@@ -149,11 +149,17 @@ static inline int ps_strcmp(const struct pathspec_item *item,
return strcmp(s1, s2);
}
+enum ps_skip_worktree_action {
+ PS_HEED_SKIP_WORKTREE = 0,
+ PS_IGNORE_SKIP_WORKTREE = 1
+};
void add_pathspec_matches_against_index(const struct pathspec *pathspec,
const struct index_state *istate,
- char *seen);
+ char *seen,
+ enum ps_skip_worktree_action sw_action);
char *find_pathspecs_matching_against_index(const struct pathspec *pathspec,
- const struct index_state *istate);
+ const struct index_state *istate,
+ enum ps_skip_worktree_action sw_action);
int match_pathspec_attrs(const struct index_state *istate,
const char *name, int namelen,
const struct pathspec_item *item);