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:
parent
f449198e58
commit
c368dde924
2
bisect.c
2
bisect.c
@ -754,7 +754,7 @@ static void handle_bad_merge_base(void)
|
|||||||
static void handle_skipped_merge_base(const unsigned char *mb)
|
static void handle_skipped_merge_base(const unsigned char *mb)
|
||||||
{
|
{
|
||||||
char *mb_hex = sha1_to_hex(mb);
|
char *mb_hex = sha1_to_hex(mb);
|
||||||
char *bad_hex = sha1_to_hex(current_bad_oid->hash);
|
char *bad_hex = oid_to_hex(current_bad_oid);
|
||||||
char *good_hex = join_sha1_array_hex(&good_revs, ' ');
|
char *good_hex = join_sha1_array_hex(&good_revs, ' ');
|
||||||
|
|
||||||
warning("the merge base between %s and [%s] "
|
warning("the merge base between %s and [%s] "
|
||||||
|
@ -501,7 +501,7 @@ static void merge_name(const char *remote, struct strbuf *msg)
|
|||||||
if (ref_exists(truname.buf)) {
|
if (ref_exists(truname.buf)) {
|
||||||
strbuf_addf(msg,
|
strbuf_addf(msg,
|
||||||
"%s\t\tbranch '%s'%s of .\n",
|
"%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,
|
truname.buf + 11,
|
||||||
(early ? " (early part)" : ""));
|
(early ? " (early part)" : ""));
|
||||||
strbuf_release(&truname);
|
strbuf_release(&truname);
|
||||||
@ -515,7 +515,7 @@ static void merge_name(const char *remote, struct strbuf *msg)
|
|||||||
desc = merge_remote_util(remote_head);
|
desc = merge_remote_util(remote_head);
|
||||||
if (desc && desc->obj && desc->obj->type == OBJ_TAG) {
|
if (desc && desc->obj && desc->obj->type == OBJ_TAG) {
|
||||||
strbuf_addf(msg, "%s\t\t%s '%s'\n",
|
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),
|
typename(desc->obj->type),
|
||||||
remote);
|
remote);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -523,7 +523,7 @@ static void merge_name(const char *remote, struct strbuf *msg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
strbuf_addf(msg, "%s\t\tcommit '%s'\n",
|
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:
|
cleanup:
|
||||||
strbuf_release(&buf);
|
strbuf_release(&buf);
|
||||||
strbuf_release(&bname);
|
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) {
|
for (p = remoteheads; p; p = p->next) {
|
||||||
struct commit *commit = p->item;
|
struct commit *commit = p->item;
|
||||||
strbuf_addf(&buf, "GITHEAD_%s",
|
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);
|
setenv(buf.buf, merge_remote_util(commit)->name, 1);
|
||||||
strbuf_reset(&buf);
|
strbuf_reset(&buf);
|
||||||
if (fast_forward != FF_ONLY &&
|
if (fast_forward != FF_ONLY &&
|
||||||
@ -1425,7 +1425,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
|
|||||||
goto done;
|
goto done;
|
||||||
} else if (fast_forward != FF_NO && !remoteheads->next &&
|
} else if (fast_forward != FF_NO && !remoteheads->next &&
|
||||||
!common->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. */
|
/* Again the most common case of merging one remote. */
|
||||||
struct strbuf msg = STRBUF_INIT;
|
struct strbuf msg = STRBUF_INIT;
|
||||||
struct commit *commit;
|
struct commit *commit;
|
||||||
@ -1499,8 +1499,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
|
|||||||
* HEAD^^" would be missed.
|
* HEAD^^" would be missed.
|
||||||
*/
|
*/
|
||||||
common_one = get_merge_bases(head_commit, j->item);
|
common_one = get_merge_bases(head_commit, j->item);
|
||||||
if (hashcmp(common_one->item->object.oid.hash,
|
if (oidcmp(&common_one->item->object.oid, &j->item->object.oid)) {
|
||||||
j->item->object.oid.hash)) {
|
|
||||||
up_to_date = 0;
|
up_to_date = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1725,14 +1725,14 @@ static int verify_lock(struct ref_lock *lock,
|
|||||||
errno = save_errno;
|
errno = save_errno;
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
hashclr(lock->old_oid.hash);
|
oidclr(&lock->old_oid);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (old_sha1 && hashcmp(lock->old_oid.hash, old_sha1)) {
|
if (old_sha1 && hashcmp(lock->old_oid.hash, old_sha1)) {
|
||||||
strbuf_addf(err, "ref %s is at %s but expected %s",
|
strbuf_addf(err, "ref %s is at %s but expected %s",
|
||||||
lock->ref_name,
|
lock->ref_name,
|
||||||
sha1_to_hex(lock->old_oid.hash),
|
oid_to_hex(&lock->old_oid),
|
||||||
sha1_to_hex(old_sha1));
|
sha1_to_hex(old_sha1));
|
||||||
errno = EBUSY;
|
errno = EBUSY;
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user