summaryrefslogtreecommitdiff
path: root/pathspec.c
diff options
context:
space:
mode:
authorAdam Spiers <git@adamspiers.org>2013-01-06 16:58:09 +0000
committerJunio C Hamano <gitster@pobox.com>2013-01-06 14:26:37 -0800
commit4b78d7bccdda25290ab6c04bf45d835b4fdfab45 (patch)
tree9a4fd81c44e12f64984af888844cee6078cce2da /pathspec.c
parent6f525e7100061fb0dbc2d9230cc9948c7c5b2978 (diff)
downloadgit-4b78d7bccdda25290ab6c04bf45d835b4fdfab45.tar.gz
pathspec.c: rename newly public functions for clarity
Perform the following function renames to make it explicit that these pathspec handling functions are for matching against the index, rather than against a tree or the working directory. - fill_pathspec_matches() -> add_pathspec_matches_against_index() - find_used_pathspec() -> find_pathspecs_matching_against_index() Signed-off-by: Adam Spiers <git@adamspiers.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pathspec.c')
-rw-r--r--pathspec.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/pathspec.c b/pathspec.c
index 1472af89ce..b73b15cbb3 100644
--- a/pathspec.c
+++ b/pathspec.c
@@ -13,9 +13,10 @@
* altogether if seen[] already only contains non-zero entries.
*
* If seen[] has not already been written to, it may make sense
- * to use find_used_pathspec() instead.
+ * to use find_pathspecs_matching_against_index() instead.
*/
-void fill_pathspec_matches(const char **pathspec, char *seen, int specs)
+void add_pathspec_matches_against_index(const char **pathspec,
+ char *seen, int specs)
{
int num_unmatched = 0, i;
@@ -39,12 +40,12 @@ void fill_pathspec_matches(const char **pathspec, char *seen, int specs)
/*
* Finds which of the given pathspecs match items in the index.
*
- * This is a one-shot wrapper around fill_pathspec_matches() which
- * allocates, populates, and returns a seen[] array indicating the
- * nature of the "closest" (i.e. most specific) matches which each of
- * the given pathspecs achieves against all items in the index.
+ * This is a one-shot wrapper around add_pathspec_matches_against_index()
+ * which allocates, populates, and returns a seen[] array indicating the
+ * nature of the "closest" (i.e. most specific) matches which each of the
+ * given pathspecs achieves against all items in the index.
*/
-char *find_used_pathspec(const char **pathspec)
+char *find_pathspecs_matching_against_index(const char **pathspec)
{
char *seen;
int i;
@@ -52,6 +53,6 @@ char *find_used_pathspec(const char **pathspec)
for (i = 0; pathspec[i]; i++)
; /* just counting */
seen = xcalloc(i, 1);
- fill_pathspec_matches(pathspec, seen, i);
+ add_pathspec_matches_against_index(pathspec, seen, i);
return seen;
}