From 99d1a9861ae88595e7386c453b6b38573a8a570c Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Mon, 5 Sep 2016 20:07:52 +0000 Subject: cache: convert struct cache_entry to use struct object_id Convert struct cache_entry to use struct object_id by applying the following semantic patch and the object_id transforms from contrib, plus the actual change to the struct: @@ struct cache_entry E1; @@ - E1.sha1 + E1.oid.hash @@ struct cache_entry *E1; @@ - E1->sha1 + E1->oid.hash Signed-off-by: brian m. carlson Signed-off-by: Junio C Hamano --- cache.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cache.h') diff --git a/cache.h b/cache.h index b780a91a56..a679484e86 100644 --- a/cache.h +++ b/cache.h @@ -173,7 +173,7 @@ struct cache_entry { unsigned int ce_flags; unsigned int ce_namelen; unsigned int index; /* for link extension */ - unsigned char sha1[20]; + struct object_id oid; char name[FLEX_ARRAY]; /* more */ }; -- cgit v1.2.3 From 151b2911c1279f3ea4b5bcc069a04348aeb9d811 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Mon, 5 Sep 2016 20:08:07 +0000 Subject: sha1_name: convert get_sha1_mb to struct object_id All of the callers of this function use struct object_id, so rename it to get_oid_mb and make it take struct object_id instead of unsigned char *. Signed-off-by: brian m. carlson Signed-off-by: Junio C Hamano --- cache.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cache.h') diff --git a/cache.h b/cache.h index a679484e86..e40165d106 100644 --- a/cache.h +++ b/cache.h @@ -1204,7 +1204,7 @@ extern char *sha1_to_hex(const unsigned char *sha1); /* static buffer result! */ extern char *oid_to_hex(const struct object_id *oid); /* same static buffer as sha1_to_hex */ extern int interpret_branch_name(const char *str, int len, struct strbuf *); -extern int get_sha1_mb(const char *str, unsigned char *sha1); +extern int get_oid_mb(const char *str, struct object_id *oid); extern int validate_headref(const char *ref); -- cgit v1.2.3