summaryrefslogtreecommitdiff
path: root/match-trees.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2019-01-24 13:11:34 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-01-24 20:35:44 (GMT)
commit667f71c36c95840c561297a5dfde2aa553c77c30 (patch)
treee74b7e98b5f39b81eab6bd758c498b59ffa6f3ec /match-trees.c
parent16a465bc018d09e9d7bbbdc5f40a7fb99c21f8ef (diff)
downloadgit-667f71c36c95840c561297a5dfde2aa553c77c30.zip
git-667f71c36c95840c561297a5dfde2aa553c77c30.tar.gz
git-667f71c36c95840c561297a5dfde2aa553c77c30.tar.bz2
match-trees: drop unused path parameter from score functions
The scores do not take the particular path into account at all. It's possible they could, but these are all static file-local functions. It won't be a big deal to re-add the parameter if they ever need it. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'match-trees.c')
-rw-r--r--match-trees.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/match-trees.c b/match-trees.c
index 2b6d31e..e65e665 100644
--- a/match-trees.c
+++ b/match-trees.c
@@ -3,7 +3,7 @@
#include "tree-walk.h"
#include "object-store.h"
-static int score_missing(unsigned mode, const char *path)
+static int score_missing(unsigned mode)
{
int score;
@@ -16,7 +16,7 @@ static int score_missing(unsigned mode, const char *path)
return score;
}
-static int score_differs(unsigned mode1, unsigned mode2, const char *path)
+static int score_differs(unsigned mode1, unsigned mode2)
{
int score;
@@ -29,7 +29,7 @@ static int score_differs(unsigned mode1, unsigned mode2, const char *path)
return score;
}
-static int score_matches(unsigned mode1, unsigned mode2, const char *path)
+static int score_matches(unsigned mode1, unsigned mode2)
{
int score;
@@ -98,24 +98,22 @@ static int score_trees(const struct object_id *hash1, const struct object_id *ha
if (cmp < 0) {
/* path1 does not appear in two */
- score += score_missing(one.entry.mode, one.entry.path);
+ score += score_missing(one.entry.mode);
update_tree_entry(&one);
} else if (cmp > 0) {
/* path2 does not appear in one */
- score += score_missing(two.entry.mode, two.entry.path);
+ score += score_missing(two.entry.mode);
update_tree_entry(&two);
} else {
/* path appears in both */
if (!oideq(one.entry.oid, two.entry.oid)) {
/* they are different */
score += score_differs(one.entry.mode,
- two.entry.mode,
- one.entry.path);
+ two.entry.mode);
} else {
/* same subtree or blob */
score += score_matches(one.entry.mode,
- two.entry.mode,
- one.entry.path);
+ two.entry.mode);
}
update_tree_entry(&one);
update_tree_entry(&two);