Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2018-03-12 05:27:42 +0300
committerJunio C Hamano <gitster@pobox.com>2018-03-14 19:23:49 +0300
commite816caa07b8acb5c8ed2d467666ca819fb80bc58 (patch)
treee0aac93a403f0c20f3e2e66b33bec4924c3fc6b5 /sha1_file.c
parent83eb08020cbce4f6dff93e6b67ce635a3cd657f0 (diff)
sha1_file: convert assert_sha1_type to object_id
Convert this function to take a pointer to struct object_id and rename it to assert_oid_type. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sha1_file.c b/sha1_file.c
index cdcba4483b..a307037e88 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -1966,13 +1966,13 @@ int read_pack_header(int fd, struct pack_header *header)
return 0;
}
-void assert_sha1_type(const unsigned char *sha1, enum object_type expect)
+void assert_oid_type(const struct object_id *oid, enum object_type expect)
{
- enum object_type type = sha1_object_info(sha1, NULL);
+ enum object_type type = sha1_object_info(oid->hash, NULL);
if (type < 0)
- die("%s is not a valid object", sha1_to_hex(sha1));
+ die("%s is not a valid object", oid_to_hex(oid));
if (type != expect)
- die("%s is not a valid '%s' object", sha1_to_hex(sha1),
+ die("%s is not a valid '%s' object", oid_to_hex(oid),
type_name(expect));
}