Thread (9 messages) read the whole thread 9 messages, 2 authors, 2017-08-20
STALE3268d

[PATCH 2/6] read-cache: convert to struct object_id

From: Patryk Obara <hidden>
Date: 2017-08-20 20:09:57
Subsystem: the rest · Maintainer: Linus Torvalds

Replace hashcmp with oidcmp.

Signed-off-by: Patryk Obara <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help