coccinelle: apply object_id Coccinelle transformations
Apply the set of semantic patches from contrib/coccinelle to convert some leftover places using struct object_id's hash member to instead use the wrapper functions that take struct object_id natively. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
f449198e58
commit
c368dde924
@ -501,7 +501,7 @@ static void merge_name(const char *remote, struct strbuf *msg)
|
||||
if (ref_exists(truname.buf)) {
|
||||
strbuf_addf(msg,
|
||||
"%s\t\tbranch '%s'%s of .\n",
|
||||
sha1_to_hex(remote_head->object.oid.hash),
|
||||
oid_to_hex(&remote_head->object.oid),
|
||||
truname.buf + 11,
|
||||
(early ? " (early part)" : ""));
|
||||
strbuf_release(&truname);
|
||||
@ -515,7 +515,7 @@ static void merge_name(const char *remote, struct strbuf *msg)
|
||||
desc = merge_remote_util(remote_head);
|
||||
if (desc && desc->obj && desc->obj->type == OBJ_TAG) {
|
||||
strbuf_addf(msg, "%s\t\t%s '%s'\n",
|
||||
sha1_to_hex(desc->obj->oid.hash),
|
||||
oid_to_hex(&desc->obj->oid),
|
||||
typename(desc->obj->type),
|
||||
remote);
|
||||
goto cleanup;
|
||||
@ -523,7 +523,7 @@ static void merge_name(const char *remote, struct strbuf *msg)
|
||||
}
|
||||
|
||||
strbuf_addf(msg, "%s\t\tcommit '%s'\n",
|
||||
sha1_to_hex(remote_head->object.oid.hash), remote);
|
||||
oid_to_hex(&remote_head->object.oid), remote);
|
||||
cleanup:
|
||||
strbuf_release(&buf);
|
||||
strbuf_release(&bname);
|
||||
@ -1366,7 +1366,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
|
||||
for (p = remoteheads; p; p = p->next) {
|
||||
struct commit *commit = p->item;
|
||||
strbuf_addf(&buf, "GITHEAD_%s",
|
||||
sha1_to_hex(commit->object.oid.hash));
|
||||
oid_to_hex(&commit->object.oid));
|
||||
setenv(buf.buf, merge_remote_util(commit)->name, 1);
|
||||
strbuf_reset(&buf);
|
||||
if (fast_forward != FF_ONLY &&
|
||||
@ -1425,7 +1425,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
|
||||
goto done;
|
||||
} else if (fast_forward != FF_NO && !remoteheads->next &&
|
||||
!common->next &&
|
||||
!hashcmp(common->item->object.oid.hash, head_commit->object.oid.hash)) {
|
||||
!oidcmp(&common->item->object.oid, &head_commit->object.oid)) {
|
||||
/* Again the most common case of merging one remote. */
|
||||
struct strbuf msg = STRBUF_INIT;
|
||||
struct commit *commit;
|
||||
@ -1499,8 +1499,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
|
||||
* HEAD^^" would be missed.
|
||||
*/
|
||||
common_one = get_merge_bases(head_commit, j->item);
|
||||
if (hashcmp(common_one->item->object.oid.hash,
|
||||
j->item->object.oid.hash)) {
|
||||
if (oidcmp(&common_one->item->object.oid, &j->item->object.oid)) {
|
||||
up_to_date = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user