From 1053fe829c037c5a725786bac35d05a113c91f55 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Sun, 15 Oct 2017 22:07:06 +0000 Subject: Convert remaining callers of resolve_gitlink_ref to object_id Signed-off-by: brian m. carlson Signed-off-by: Junio C Hamano --- unpack-trees.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'unpack-trees.c') diff --git a/unpack-trees.c b/unpack-trees.c index 71b70ccb1..0dc76eddf 100644 --- a/unpack-trees.c +++ b/unpack-trees.c @@ -1541,15 +1541,15 @@ static int verify_clean_subdirectory(const struct cache_entry *ce, int cnt = 0; if (S_ISGITLINK(ce->ce_mode)) { - unsigned char sha1[20]; - int sub_head = resolve_gitlink_ref(ce->name, "HEAD", sha1); + struct object_id oid; + int sub_head = resolve_gitlink_ref(ce->name, "HEAD", oid.hash); /* * If we are not going to update the submodule, then * we don't care. */ - if (!sub_head && !hashcmp(sha1, ce->oid.hash)) + if (!sub_head && !oidcmp(&oid, &ce->oid)) return 0; - return verify_clean_submodule(sub_head ? NULL : sha1_to_hex(sha1), + return verify_clean_submodule(sub_head ? NULL : oid_to_hex(&oid), ce, error_type, o); } -- cgit v1.2.1 From a98e6101f01b6991e780fc0b75f2937615fa84a9 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Sun, 15 Oct 2017 22:07:07 +0000 Subject: refs: convert resolve_gitlink_ref to struct object_id Convert the declaration and definition of resolve_gitlink_ref to use struct object_id and apply the following semantic patch: @@ expression E1, E2, E3; @@ - resolve_gitlink_ref(E1, E2, E3.hash) + resolve_gitlink_ref(E1, E2, &E3) @@ expression E1, E2, E3; @@ - resolve_gitlink_ref(E1, E2, E3->hash) + resolve_gitlink_ref(E1, E2, E3) Signed-off-by: brian m. carlson Signed-off-by: Junio C Hamano --- unpack-trees.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'unpack-trees.c') diff --git a/unpack-trees.c b/unpack-trees.c index 0dc76eddf..25740cb59 100644 --- a/unpack-trees.c +++ b/unpack-trees.c @@ -1542,7 +1542,7 @@ static int verify_clean_subdirectory(const struct cache_entry *ce, if (S_ISGITLINK(ce->ce_mode)) { struct object_id oid; - int sub_head = resolve_gitlink_ref(ce->name, "HEAD", oid.hash); + int sub_head = resolve_gitlink_ref(ce->name, "HEAD", &oid); /* * If we are not going to update the submodule, then * we don't care. -- cgit v1.2.1