Merge branch 'bc/object-id'
Conversion from uchar[20] to struct object_id continues. * bc/object-id: (53 commits) object: convert parse_object* to take struct object_id tree: convert parse_tree_indirect to struct object_id sequencer: convert do_recursive_merge to struct object_id diff-lib: convert do_diff_cache to struct object_id builtin/ls-tree: convert to struct object_id merge: convert checkout_fast_forward to struct object_id sequencer: convert fast_forward_to to struct object_id builtin/ls-files: convert overlay_tree_on_cache to object_id builtin/read-tree: convert to struct object_id sha1_name: convert internals of peel_onion to object_id upload-pack: convert remaining parse_object callers to object_id revision: convert remaining parse_object callers to object_id revision: rename add_pending_sha1 to add_pending_oid http-push: convert process_ls_object and descendants to object_id refs/files-backend: convert many internals to struct object_id refs: convert struct ref_update to use struct object_id ref-filter: convert some static functions to struct object_id Convert struct ref_array_item to struct object_id Convert the verify_pack callback to struct object_id Convert lookup_tag to struct object_id ...
This commit is contained in:
24
submodule.c
24
submodule.c
@ -447,8 +447,8 @@ static void show_submodule_header(FILE *f, const char *path,
|
||||
* Attempt to lookup the commit references, and determine if this is
|
||||
* a fast forward or fast backwards update.
|
||||
*/
|
||||
*left = lookup_commit_reference(one->hash);
|
||||
*right = lookup_commit_reference(two->hash);
|
||||
*left = lookup_commit_reference(one);
|
||||
*right = lookup_commit_reference(two);
|
||||
|
||||
/*
|
||||
* Warn about missing commits in the submodule project, but only if
|
||||
@ -723,7 +723,7 @@ static int check_has_commit(const struct object_id *oid, void *data)
|
||||
{
|
||||
int *has_commit = data;
|
||||
|
||||
if (!lookup_commit_reference(oid->hash))
|
||||
if (!lookup_commit_reference(oid))
|
||||
*has_commit = 0;
|
||||
|
||||
return 0;
|
||||
@ -1584,9 +1584,9 @@ static void print_commit(struct commit *commit)
|
||||
#define MERGE_WARNING(path, msg) \
|
||||
warning("Failed to merge submodule %s (%s)", path, msg);
|
||||
|
||||
int merge_submodule(unsigned char result[20], const char *path,
|
||||
const unsigned char base[20], const unsigned char a[20],
|
||||
const unsigned char b[20], int search)
|
||||
int merge_submodule(struct object_id *result, const char *path,
|
||||
const struct object_id *base, const struct object_id *a,
|
||||
const struct object_id *b, int search)
|
||||
{
|
||||
struct commit *commit_base, *commit_a, *commit_b;
|
||||
int parent_count;
|
||||
@ -1595,14 +1595,14 @@ int merge_submodule(unsigned char result[20], const char *path,
|
||||
int i;
|
||||
|
||||
/* store a in result in case we fail */
|
||||
hashcpy(result, a);
|
||||
oidcpy(result, a);
|
||||
|
||||
/* we can not handle deletion conflicts */
|
||||
if (is_null_sha1(base))
|
||||
if (is_null_oid(base))
|
||||
return 0;
|
||||
if (is_null_sha1(a))
|
||||
if (is_null_oid(a))
|
||||
return 0;
|
||||
if (is_null_sha1(b))
|
||||
if (is_null_oid(b))
|
||||
return 0;
|
||||
|
||||
if (add_submodule_odb(path)) {
|
||||
@ -1626,11 +1626,11 @@ int merge_submodule(unsigned char result[20], const char *path,
|
||||
|
||||
/* Case #1: a is contained in b or vice versa */
|
||||
if (in_merge_bases(commit_a, commit_b)) {
|
||||
hashcpy(result, b);
|
||||
oidcpy(result, b);
|
||||
return 1;
|
||||
}
|
||||
if (in_merge_bases(commit_b, commit_a)) {
|
||||
hashcpy(result, a);
|
||||
oidcpy(result, a);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user