All of lore.kernel.org
 help / color / mirror / Atom feed
From: Elijah Newren <newren@gmail.com>
To: git@vger.kernel.org
Cc: Elijah Newren <newren@gmail.com>
Subject: [PATCH 2/4] merge-recursive: avoid wrapper function when unnecessary and wasteful
Date: Wed, 19 Sep 2018 09:14:32 -0700	[thread overview]
Message-ID: <20180919161434.3272-3-newren@gmail.com> (raw)
In-Reply-To: <20180919161434.3272-1-newren@gmail.com>

merge_file_one() is a convenience function taking a bunch of oids and
modes, combining each pair into a diff_filespec, and then calling
merge_file_1().  When we already start with diff_filespec's, we can
just call merge_file_1() directly instead of splitting out the oids
and modes for the wrapper to recombine into what we already had.

Signed-off-by: Elijah Newren <newren@gmail.com>
---
 merge-recursive.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/merge-recursive.c b/merge-recursive.c
index 99a7ac5ec7..9e4e3da672 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -1630,10 +1630,7 @@ static int handle_rename_rename_1to2(struct merge_options *o,
 		struct merge_file_info mfi;
 		struct diff_filespec other;
 		struct diff_filespec *add;
-		if (merge_file_one(o, one->path,
-				 &one->oid, one->mode,
-				 &a->oid, a->mode,
-				 &b->oid, b->mode,
+		if (merge_file_1(o, one, a, b, one->path,
 				 ci->branch1, ci->branch2, &mfi))
 			return -1;
 
-- 
2.19.0.12.gc6760fd9a9


  parent reply	other threads:[~2018-09-19 16:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-19 16:14 [PATCH 0/4] Cleanup of merge_*() functions in merge-recursive Elijah Newren
2018-09-19 16:14 ` [PATCH 1/4] merge-recursive: set paths correctly when three-way merging content Elijah Newren
2018-09-19 16:14 ` Elijah Newren [this message]
2018-09-19 16:14 ` [PATCH 3/4] merge-recursive: remove final remaining caller of merge_file_one() Elijah Newren
2018-09-19 16:14 ` [PATCH 4/4] merge-recursive: rename merge_file_1() and merge_content() Elijah Newren
2018-09-19 23:40   ` Stefan Beller

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

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

  git send-email \
    --in-reply-to=20180919161434.3272-3-newren@gmail.com \
    --to=newren@gmail.com \
    --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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.