summaryrefslogtreecommitdiff
path: root/sha1_name.c
diff options
context:
space:
mode:
authorLibravatar brian m. carlson <sandals@crustytoothpaste.net>2018-03-12 02:27:46 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-03-14 09:23:49 -0700
commitabef9020e3df87c441c9a3a95f592fce5fa49bb9 (patch)
treeb04714a271049de3d7402e20e868beb5cee30995 /sha1_name.c
parentConvert remaining callers of sha1_object_info_extended to object_id (diff)
downloadtgif-abef9020e3df87c441c9a3a95f592fce5fa49bb9.tar.xz
sha1_file: convert sha1_object_info* to object_id
Convert sha1_object_info and sha1_object_info_extended to take pointers to struct object_id and rename them to use "oid" instead of "sha1" in their names. Update the declaration and definition and apply the following semantic patch, plus the standard object_id transforms: @@ expression E1, E2; @@ - sha1_object_info(E1.hash, E2) + oid_object_info(&E1, E2) @@ expression E1, E2; @@ - sha1_object_info(E1->hash, E2) + oid_object_info(E1, E2) @@ expression E1, E2, E3; @@ - sha1_object_info_extended(E1.hash, E2, E3) + oid_object_info_extended(&E1, E2, E3) @@ expression E1, E2, E3; @@ - sha1_object_info_extended(E1->hash, E2, E3) + oid_object_info_extended(E1, E2, E3) Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sha1_name.c')
-rw-r--r--sha1_name.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sha1_name.c b/sha1_name.c
index b59f3ed748..d129dc4f31 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -238,7 +238,7 @@ static int finish_object_disambiguation(struct disambiguate_state *ds,
static int disambiguate_commit_only(const struct object_id *oid, void *cb_data_unused)
{
- int kind = sha1_object_info(oid->hash, NULL);
+ int kind = oid_object_info(oid, NULL);
return kind == OBJ_COMMIT;
}
@@ -247,7 +247,7 @@ static int disambiguate_committish_only(const struct object_id *oid, void *cb_da
struct object *obj;
int kind;
- kind = sha1_object_info(oid->hash, NULL);
+ kind = oid_object_info(oid, NULL);
if (kind == OBJ_COMMIT)
return 1;
if (kind != OBJ_TAG)
@@ -262,7 +262,7 @@ static int disambiguate_committish_only(const struct object_id *oid, void *cb_da
static int disambiguate_tree_only(const struct object_id *oid, void *cb_data_unused)
{
- int kind = sha1_object_info(oid->hash, NULL);
+ int kind = oid_object_info(oid, NULL);
return kind == OBJ_TREE;
}
@@ -271,7 +271,7 @@ static int disambiguate_treeish_only(const struct object_id *oid, void *cb_data_
struct object *obj;
int kind;
- kind = sha1_object_info(oid->hash, NULL);
+ kind = oid_object_info(oid, NULL);
if (kind == OBJ_TREE || kind == OBJ_COMMIT)
return 1;
if (kind != OBJ_TAG)
@@ -286,7 +286,7 @@ static int disambiguate_treeish_only(const struct object_id *oid, void *cb_data_
static int disambiguate_blob_only(const struct object_id *oid, void *cb_data_unused)
{
- int kind = sha1_object_info(oid->hash, NULL);
+ int kind = oid_object_info(oid, NULL);
return kind == OBJ_BLOB;
}
@@ -365,7 +365,7 @@ static int show_ambiguous_object(const struct object_id *oid, void *data)
if (ds->fn && !ds->fn(oid, ds->cb_data))
return 0;
- type = sha1_object_info(oid->hash, NULL);
+ type = oid_object_info(oid, NULL);
if (type == OBJ_COMMIT) {
struct commit *commit = lookup_commit(oid);
if (commit) {