git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: git@vger.kernel.org
Subject: [PATCH 8/8] convert: drop path parameter from actual conversion functions
Date: Thu, 24 Jan 2019 08:12:51 -0500	[thread overview]
Message-ID: <20190124131250.GH22398@sigill.intra.peff.net> (raw)
In-Reply-To: <20190124131104.GA24017@sigill.intra.peff.net>

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>
---
 convert.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/convert.c b/convert.c
index dafd6db643..d8d7df3353 100644
--- a/convert.c
+++ b/convert.c
@@ -591,7 +591,7 @@ static int crlf_to_git(const struct index_state *istate,
 	return 1;
 }
 
-static int crlf_to_worktree(const char *path, const char *src, size_t len,
+static int crlf_to_worktree(const char *src, size_t len,
 			    struct strbuf *buf, enum crlf_action crlf_action)
 {
 	char *to_free = NULL;
@@ -1091,7 +1091,7 @@ static int count_ident(const char *cp, unsigned long size)
 	return cnt;
 }
 
-static int ident_to_git(const char *path, const char *src, size_t len,
+static int ident_to_git(const char *src, size_t len,
 			struct strbuf *buf, int ident)
 {
 	char *dst, *dollar;
@@ -1135,7 +1135,7 @@ static int ident_to_git(const char *path, const char *src, size_t len,
 	return 1;
 }
 
-static int ident_to_worktree(const char *path, const char *src, size_t len,
+static int ident_to_worktree(const char *src, size_t len,
 			     struct strbuf *buf, int ident)
 {
 	struct object_id oid;
@@ -1416,7 +1416,7 @@ int convert_to_git(const struct index_state *istate,
 			len = dst->len;
 		}
 	}
-	return ret | ident_to_git(path, src, len, dst, ca.ident);
+	return ret | ident_to_git(src, len, dst, ca.ident);
 }
 
 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,
 
 	encode_to_git(path, dst->buf, dst->len, dst, ca.working_tree_encoding, conv_flags);
 	crlf_to_git(istate, path, dst->buf, dst->len, dst, ca.crlf_action, conv_flags);
-	ident_to_git(path, dst->buf, dst->len, dst, ca.ident);
+	ident_to_git(dst->buf, dst->len, dst, ca.ident);
 }
 
 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,
 
 	convert_attrs(istate, &ca, path);
 
-	ret |= ident_to_worktree(path, src, len, dst, ca.ident);
+	ret |= ident_to_worktree(src, len, dst, ca.ident);
 	if (ret) {
 		src = dst->buf;
 		len = dst->len;
@@ -1458,7 +1458,7 @@ static int convert_to_working_tree_internal(const struct index_state *istate,
 	 * support smudge).  The filters might expect CRLFs.
 	 */
 	if ((ca.drv && (ca.drv->smudge || ca.drv->process)) || !normalizing) {
-		ret |= crlf_to_worktree(path, src, len, dst, ca.crlf_action);
+		ret |= crlf_to_worktree(src, len, dst, ca.crlf_action);
 		if (ret) {
 			src = dst->buf;
 			len = dst->len;
-- 
2.20.1.842.g8986705066

  parent reply	other threads:[~2019-01-24 13:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-24 13:11 [PATCH 0/9] drop some unused parameters Jeff King
2019-01-24 13:11 ` [PATCH 1/8] match-trees: drop unused path parameter from score functions Jeff King
2019-01-24 13:11 ` [PATCH 2/8] apply: drop unused "def" parameter from find_name_gnu() Jeff King
2019-01-24 13:11 ` [PATCH 3/8] create_bundle(): drop unused "header" parameter Jeff King
2019-01-24 13:11 ` [PATCH 4/8] column: drop unused "opts" parameter in item_length() Jeff King
2019-01-24 13:12 ` [PATCH 5/8] show_date_relative(): drop unused "tz" parameter Jeff King
2019-01-24 14:07   ` Derrick Stolee
2019-01-24 13:12 ` [PATCH 6/8] config: drop unused parameter from maybe_remove_section() Jeff King
2019-01-24 13:12 ` [PATCH 7/8] convert: drop len parameter from conversion checks Jeff King
2019-01-24 13:12 ` Jeff King [this message]
2019-01-24 14:09 ` [PATCH 0/9] drop some unused parameters Derrick Stolee
2019-01-24 20:35 ` Junio C Hamano
2019-01-25  1:53 ` brian m. carlson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190124131250.GH22398@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).