summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2014-01-24 13:40:30 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-02-24 22:37:14 (GMT)
commit854b09592ce9a497f56f35d973c4abe43af84cd1 (patch)
tree7710a0609602c4cb06b6b753da28e4d1518aff39 /dir.c
parentebb32893bad46bf5edae881552672a47dd2684b8 (diff)
downloadgit-854b09592ce9a497f56f35d973c4abe43af84cd1.zip
git-854b09592ce9a497f56f35d973c4abe43af84cd1.tar.gz
git-854b09592ce9a497f56f35d973c4abe43af84cd1.tar.bz2
pathspec: rename match_pathspec_depth() to match_pathspec()
A long time ago, for some reason I was not happy with match_pathspec(). I created a better version, match_pathspec_depth() that was suppose to replace match_pathspec() eventually. match_pathspec() has finally been gone since 6 months ago. Use the shorter name for match_pathspec_depth(). Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/dir.c b/dir.c
index b35b633..442a548 100644
--- a/dir.c
+++ b/dir.c
@@ -218,7 +218,7 @@ static int match_pathspec_item(const struct pathspec_item *item, int prefix,
* The normal call pattern is:
* 1. prefix = common_prefix_len(ps);
* 2. prune something, or fill_directory
- * 3. match_pathspec_depth()
+ * 3. match_pathspec()
*
* 'prefix' at #1 may be shorter than the command's prefix and
* it's ok for #2 to match extra files. Those extras will be
@@ -282,10 +282,10 @@ static int match_pathspec_item(const struct pathspec_item *item, int prefix,
* pathspec did not match any names, which could indicate that the
* user mistyped the nth pathspec.
*/
-static int match_pathspec_depth_1(const struct pathspec *ps,
- const char *name, int namelen,
- int prefix, char *seen,
- int exclude)
+static int do_match_pathspec(const struct pathspec *ps,
+ const char *name, int namelen,
+ int prefix, char *seen,
+ int exclude)
{
int i, retval = 0;
@@ -350,15 +350,15 @@ static int match_pathspec_depth_1(const struct pathspec *ps,
return retval;
}
-int match_pathspec_depth(const struct pathspec *ps,
- const char *name, int namelen,
- int prefix, char *seen)
+int match_pathspec(const struct pathspec *ps,
+ const char *name, int namelen,
+ int prefix, char *seen)
{
int positive, negative;
- positive = match_pathspec_depth_1(ps, name, namelen, prefix, seen, 0);
+ positive = do_match_pathspec(ps, name, namelen, prefix, seen, 0);
if (!(ps->magic & PATHSPEC_EXCLUDE) || !positive)
return positive;
- negative = match_pathspec_depth_1(ps, name, namelen, prefix, seen, 1);
+ negative = do_match_pathspec(ps, name, namelen, prefix, seen, 1);
return negative ? 0 : positive;
}