convert: drop path parameter from actual conversion functions

The caller is responsible for looking up the attributes, after which point we no longer care about the path at which the content is found. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Jan 24, 2019 at 08:12 UTC 55ad152cfbf99409859fc8f7a1d602d9c47415a4
1 file changed +7 -7
convert.c
+7 -7
@@ -591,7 +591,7 @@ static int crlf_to_git(const struct index_state *istate,
591 return 1;
592 }
593
594 -static int crlf_to_worktree(const char *path, const char *src, size_t len,
594 +static int crlf_to_worktree(const char *src, size_t len,
595 struct strbuf *buf, enum crlf_action crlf_action)
596 {
597 char *to_free = NULL;
@@ -1091,7 +1091,7 @@ static int count_ident(const char *cp, unsigned long size)
1091 return cnt;
1092 }
1093
1094 -static int ident_to_git(const char *path, const char *src, size_t len,
1094 +static int ident_to_git(const char *src, size_t len,
1095 struct strbuf *buf, int ident)
1096 {
1097 char *dst, *dollar;
@@ -1135,7 +1135,7 @@ static int ident_to_git(const char *path, const char *src, size_t len,
1135 return 1;
1136 }
1137
1138 -static int ident_to_worktree(const char *path, const char *src, size_t len,
1138 +static int ident_to_worktree(const char *src, size_t len,
1139 struct strbuf *buf, int ident)
1140 {
1141 struct object_id oid;
@@ -1416,7 +1416,7 @@ int convert_to_git(const struct index_state *istate,
1416 len = dst->len;
1417 }
1418 }
1419 - return ret | ident_to_git(path, src, len, dst, ca.ident);
1419 + return ret | ident_to_git(src, len, dst, ca.ident);
1420 }
1421
1422 void convert_to_git_filter_fd(const struct index_state *istate,
@@ -1434,7 +1434,7 @@ void convert_to_git_filter_fd(const struct index_state *istate,
1434
1435 encode_to_git(path, dst->buf, dst->len, dst, ca.working_tree_encoding, conv_flags);
1436 crlf_to_git(istate, path, dst->buf, dst->len, dst, ca.crlf_action, conv_flags);
1437 - ident_to_git(path, dst->buf, dst->len, dst, ca.ident);
1437 + ident_to_git(dst->buf, dst->len, dst, ca.ident);
1438 }
1439
1440 static int convert_to_working_tree_internal(const struct index_state *istate,
@@ -1447,7 +1447,7 @@ static int convert_to_working_tree_internal(const struct index_state *istate,
1447
1448 convert_attrs(istate, &ca, path);
1449
1450 - ret |= ident_to_worktree(path, src, len, dst, ca.ident);
1450 + ret |= ident_to_worktree(src, len, dst, ca.ident);
1451 if (ret) {
1452 src = dst->buf;
1453 len = dst->len;
@@ -1458,7 +1458,7 @@ static int convert_to_working_tree_internal(const struct index_state *istate,
1458 * support smudge). The filters might expect CRLFs.
1459 */
1460 if ((ca.drv && (ca.drv->smudge || ca.drv->process)) || !normalizing) {
1461 - ret |= crlf_to_worktree(path, src, len, dst, ca.crlf_action);
1461 + ret |= crlf_to_worktree(src, len, dst, ca.crlf_action);
1462 if (ret) {
1463 src = dst->buf;
1464 len = dst->len;