diff options
author | Junio C Hamano <gitster@pobox.com> | 2024-04-03 20:14:48 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-04-03 23:55:21 +0200 |
commit | 86829f3f3ea62853a4a632637ade6de94a1f4c7c (patch) | |
tree | 9b50facfa74dd050a84ef13207d4e4f0b69c5d18 /read-cache-ll.h | |
parent | The twelfth batch (diff) | |
download | git-86829f3f3ea62853a4a632637ade6de94a1f4c7c.tar.xz git-86829f3f3ea62853a4a632637ade6de94a1f4c7c.zip |
revision: optionally record matches with pathspec elements
Unlike "git add" and other end-user facing commands, where it is
diagnosed as an error to give a pathspec with an element that does
not match any path, the diff machinery does not care if some
elements of the pathspec do not match. Given that the diff
machinery is heavily used in pathspec-limited "git log" machinery,
and it is common for a path to come and go while traversing the
project history, this is usually a good thing.
However, in some cases we would want to know if all the pathspec
elements matched. For example, "git add -u <pathspec>" internally
uses the machinery used by "git diff-files" to decide contents from
what paths to add to the index, and as an end-user facing command,
"git add -u" would want to report an unmatched pathspec element.
Add a new .ps_matched member next to the .prune_data member in
"struct rev_info" so that we can optionally keep track of the use of
.prune_data pathspec elements that can be inspected by the caller.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'read-cache-ll.h')
-rw-r--r-- | read-cache-ll.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/read-cache-ll.h b/read-cache-ll.h index 2a50a784f0..09414afd04 100644 --- a/read-cache-ll.h +++ b/read-cache-ll.h @@ -480,8 +480,8 @@ extern int verify_ce_order; int cmp_cache_name_compare(const void *a_, const void *b_); int add_files_to_cache(struct repository *repo, const char *prefix, - const struct pathspec *pathspec, int include_sparse, - int flags); + const struct pathspec *pathspec, char *ps_matched, + int include_sparse, int flags); void overlay_tree_on_index(struct index_state *istate, const char *tree_name, const char *prefix); |