610
if (!(cache_tree_oid = get_cache_tree_oid()))
611
return -1;
612
613
- return !oidcmp(cache_tree_oid, get_commit_tree_oid(head_commit));
613
+ return oideq(cache_tree_oid, get_commit_tree_oid(head_commit));
614
}
615
616
static int write_author_script(const char *message)
1258
goto out;
1259
}
1260
1261
- if (!(flags & ALLOW_EMPTY) && !oidcmp(current_head ?
1262
- get_commit_tree_oid(current_head) :
1263
- the_hash_algo->empty_tree, &tree)) {
1261
+ if (!(flags & ALLOW_EMPTY) && oideq(current_head ?
1262
+ get_commit_tree_oid(current_head) :
1263
+ the_hash_algo->empty_tree, &tree)) {
1264
res = 1; /* run 'git commit' to display error message */
1265
goto out;
1266
}
1365
ptree_oid = the_hash_algo->empty_tree; /* commit is root */
1366
}
1367
1368
- return !oidcmp(ptree_oid, get_commit_tree_oid(commit));
1368
+ return oideq(ptree_oid, get_commit_tree_oid(commit));
1369
}
1370
1371
/*
1645
unborn = get_oid("HEAD", &head);
1646
/* Do we want to generate a root commit? */
1647
if (is_pick_or_similar(command) && opts->have_squash_onto &&
1648
- !oidcmp(&head, &opts->squash_onto)) {
1648
+ oideq(&head, &opts->squash_onto)) {
1649
if (is_fixup(command))
1650
return error(_("cannot fixup root commit"));
1651
flags |= CREATE_ROOT_COMMIT;
1688
oid_to_hex(&commit->object.oid));
1689
1690
if (opts->allow_ff && !is_fixup(command) &&
1691
- ((parent && !oidcmp(&parent->object.oid, &head)) ||
1691
+ ((parent && oideq(&parent->object.oid, &head)) ||
1692
(!parent && unborn))) {
1693
if (is_rebase_i(opts))
1694
write_author_script(msg.message);
2393
if (get_oid("HEAD", &actual_head))
2394
oidclr(&actual_head);
2395
2396
- return !oidcmp(&actual_head, &expected_head);
2396
+ return oideq(&actual_head, &expected_head);
2397
}
2398
2399
static int reset_for_rollback(const struct object_id *oid)
2954
}
2955
2956
if (opts->have_squash_onto &&
2957
- !oidcmp(&head_commit->object.oid, &opts->squash_onto)) {
2957
+ oideq(&head_commit->object.oid, &opts->squash_onto)) {
2958
/*
2959
* When the user tells us to "merge" something into a
2960
* "[new root]", let's simply fast-forward to the merge head.
3023
* commit, we cannot fast-forward.
3024
*/
3025
can_fast_forward = opts->allow_ff && commit && commit->parents &&
3026
- !oidcmp(&commit->parents->item->object.oid,
3027
- &head_commit->object.oid);
3026
+ oideq(&commit->parents->item->object.oid,
3027
+ &head_commit->object.oid);
3028
3029
/*
3030
* If any merge head is different from the original one, we cannot
3102
write_message("no-ff", 5, git_path_merge_mode(the_repository), 0);
3103
3104
bases = get_merge_bases(head_commit, merge_commit);
3105
- if (bases && !oidcmp(&merge_commit->object.oid,
3106
- &bases->item->object.oid)) {
3105
+ if (bases && oideq(&merge_commit->object.oid,
3106
+ &bases->item->object.oid)) {
3107
ret = 0;
3108
/* skip merging an ancestor of HEAD */
3109
goto leave_merge;
3349
*/
3350
if (item->command == TODO_REWORD &&
3351
!get_oid("HEAD", &oid) &&
3352
- (!oidcmp(&item->commit->object.oid, &oid) ||
3352
+ (oideq(&item->commit->object.oid, &oid) ||
3353
(opts->have_squash_onto &&
3354
- !oidcmp(&opts->squash_onto, &oid))))
3354
+ oideq(&opts->squash_onto, &oid))))
3355
to_amend = 1;
3356
3357
return res | error_with_patch(item->commit,
3578
* the commit message and if there was a squash, let the user
3579
* edit it.
3580
*/
3581
- if (is_clean && !oidcmp(&head, &to_amend) &&
3581
+ if (is_clean && oideq(&head, &to_amend) &&
3582
opts->current_fixup_count > 0 &&
3583
file_exists(rebase_path_stopped_sha())) {
3584
const char *p = opts->current_fixups.buf;