git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patryk Obara <patryk.obara@gmail.com>
To: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
	"brian m . carlson" <sandals@crustytoothpaste.net>
Subject: [PATCH 2/6] read-cache: convert to struct object_id
Date: Sun, 20 Aug 2017 22:09:27 +0200	[thread overview]
Message-ID: <27ec6a8d1b6fc49cadf7f9e7fed2c2605e02f626.1503258223.git.patryk.obara@gmail.com> (raw)
In-Reply-To: <cover.1503258223.git.patryk.obara@gmail.com>
In-Reply-To: <cover.1503258223.git.patryk.obara@gmail.com>

Replace hashcmp with oidcmp.

Signed-off-by: Patryk Obara <patryk.obara@gmail.com>
---
 read-cache.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/read-cache.c b/read-cache.c
index acfb028..7285608 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -160,9 +160,9 @@ static int ce_compare_data(const struct cache_entry *ce, struct stat *st)
 	int fd = git_open_cloexec(ce->name, O_RDONLY);
 
 	if (fd >= 0) {
-		unsigned char sha1[20];
-		if (!index_fd(sha1, fd, st, OBJ_BLOB, ce->name, 0))
-			match = hashcmp(sha1, ce->oid.hash);
+		struct object_id oid;
+		if (!index_fd(oid.hash, fd, st, OBJ_BLOB, ce->name, 0))
+			match = oidcmp(&oid, &ce->oid);
 		/* index_fd() closed the file descriptor already */
 	}
 	return match;
-- 
2.9.5


  parent reply	other threads:[~2017-08-20 20:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-20 20:09 [PATCH 0/6] Convert hash-object to struct object_id Patryk Obara
2017-08-20 20:09 ` [PATCH 1/6] builtin/hash-object: convert " Patryk Obara
2017-08-20 20:09 ` Patryk Obara [this message]
2017-08-20 20:09 ` [PATCH 3/6] sha1_file: convert index_path " Patryk Obara
2017-08-20 20:09 ` [PATCH 4/6] sha1_file: convert index_fd " Patryk Obara
2017-08-20 20:09 ` [PATCH 5/6] sha1_file: convert hash_sha1_file_literally " Patryk Obara
2017-08-20 20:37   ` brian m. carlson
2017-08-20 20:09 ` [PATCH 6/6] sha1_file: convert index_stream " Patryk Obara
2017-08-20 20:25 ` [PATCH 0/6] Convert hash-object " brian m. carlson
2017-08-21  4:59   ` Junio C Hamano

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=27ec6a8d1b6fc49cadf7f9e7fed2c2605e02f626.1503258223.git.patryk.obara@gmail.com \
    --to=patryk.obara@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sandals@crustytoothpaste.net \
    /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 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 NNTP newsgroup(s).