Commit dc83d32a by Vicent Martí

Merge pull request #1537 from ethomson/merge_warning_cleanup

puns are not funny; type punning especially so
parents af7689ea 4e7c1560
...@@ -357,7 +357,7 @@ static int merge_conflict_resolve_trivial( ...@@ -357,7 +357,7 @@ static int merge_conflict_resolve_trivial(
git_merge_diff_list *diff_list, git_merge_diff_list *diff_list,
const git_merge_diff *conflict) const git_merge_diff *conflict)
{ {
int ancestor_empty, ours_empty, theirs_empty; int ours_empty, theirs_empty;
int ours_changed, theirs_changed, ours_theirs_differ; int ours_changed, theirs_changed, ours_theirs_differ;
git_index_entry const *result = NULL; git_index_entry const *result = NULL;
int error = 0; int error = 0;
...@@ -374,7 +374,6 @@ static int merge_conflict_resolve_trivial( ...@@ -374,7 +374,6 @@ static int merge_conflict_resolve_trivial(
conflict->their_status == GIT_DELTA_RENAMED) conflict->their_status == GIT_DELTA_RENAMED)
return 0; return 0;
ancestor_empty = !GIT_MERGE_INDEX_ENTRY_EXISTS(conflict->ancestor_entry);
ours_empty = !GIT_MERGE_INDEX_ENTRY_EXISTS(conflict->our_entry); ours_empty = !GIT_MERGE_INDEX_ENTRY_EXISTS(conflict->our_entry);
theirs_empty = !GIT_MERGE_INDEX_ENTRY_EXISTS(conflict->their_entry); theirs_empty = !GIT_MERGE_INDEX_ENTRY_EXISTS(conflict->their_entry);
...@@ -678,6 +677,7 @@ static int index_entry_similarity_calc( ...@@ -678,6 +677,7 @@ static int index_entry_similarity_calc(
{ {
git_blob *blob; git_blob *blob;
git_diff_file diff_file = {{{0}}}; git_diff_file diff_file = {{{0}}};
git_off_t blobsize;
int error; int error;
*out = NULL; *out = NULL;
...@@ -691,8 +691,14 @@ static int index_entry_similarity_calc( ...@@ -691,8 +691,14 @@ static int index_entry_similarity_calc(
diff_file.mode = entry->mode; diff_file.mode = entry->mode;
diff_file.flags = 0; diff_file.flags = 0;
blobsize = git_blob_rawsize(blob);
/* file too big for rename processing */
if (!git__is_sizet(blobsize))
return 0;
error = opts->metric->buffer_signature(out, &diff_file, error = opts->metric->buffer_signature(out, &diff_file,
git_blob_rawcontent(blob), git_blob_rawsize(blob), git_blob_rawcontent(blob), (size_t)blobsize,
opts->metric->payload); opts->metric->payload);
git_blob_free(blob); git_blob_free(blob);
...@@ -1273,7 +1279,7 @@ int git_merge_diff_list__find_differences( ...@@ -1273,7 +1279,7 @@ int git_merge_diff_list__find_differences(
git_vector_cmp entry_compare = git_index_entry__cmp; git_vector_cmp entry_compare = git_index_entry__cmp;
struct merge_diff_df_data df_data = {0}; struct merge_diff_df_data df_data = {0};
int cur_item_modified; int cur_item_modified;
size_t i; size_t i, j;
int error = 0; int error = 0;
assert(diff_list && our_tree && their_tree); assert(diff_list && our_tree && their_tree);
...@@ -1290,7 +1296,9 @@ int git_merge_diff_list__find_differences( ...@@ -1290,7 +1296,9 @@ int git_merge_diff_list__find_differences(
} }
while (true) { while (true) {
memset(cur_items, 0x0, sizeof(git_index_entry *) * 3); for (i = 0; i < 3; i++)
cur_items[i] = NULL;
best_cur_item = NULL; best_cur_item = NULL;
cur_item_modified = 0; cur_item_modified = 0;
...@@ -1312,7 +1320,9 @@ int git_merge_diff_list__find_differences( ...@@ -1312,7 +1320,9 @@ int git_merge_diff_list__find_differences(
* Found an item that sorts before our current item, make * Found an item that sorts before our current item, make
* our current item this one. * our current item this one.
*/ */
memset(cur_items, 0x0, sizeof(git_index_entry *) * 3); for (j = 0; j < i; j++)
cur_items[j] = NULL;
cur_item_modified = 1; cur_item_modified = 1;
best_cur_item = items[i]; best_cur_item = items[i];
cur_items[i] = items[i]; cur_items[i] = items[i];
......
...@@ -149,9 +149,9 @@ static int name_entry_eq_merge_name_entry(const struct merge_name_entry *expecte ...@@ -149,9 +149,9 @@ static int name_entry_eq_merge_name_entry(const struct merge_name_entry *expecte
static int index_conflict_data_eq_merge_diff(const struct merge_index_conflict_data *expected, git_merge_diff *actual) static int index_conflict_data_eq_merge_diff(const struct merge_index_conflict_data *expected, git_merge_diff *actual)
{ {
if (!index_entry_eq_merge_index_entry((const struct merge_index_entry *)&expected->ancestor, &actual->ancestor_entry) || if (!index_entry_eq_merge_index_entry(&expected->ancestor.entry, &actual->ancestor_entry) ||
!index_entry_eq_merge_index_entry((const struct merge_index_entry *)&expected->ours, &actual->our_entry) || !index_entry_eq_merge_index_entry(&expected->ours.entry, &actual->our_entry) ||
!index_entry_eq_merge_index_entry((const struct merge_index_entry *)&expected->theirs, &actual->their_entry)) !index_entry_eq_merge_index_entry(&expected->theirs.entry, &actual->their_entry))
return 0; return 0;
if (expected->ours.status != actual->our_status || if (expected->ours.status != actual->our_status ||
......
...@@ -18,11 +18,8 @@ struct merge_name_entry { ...@@ -18,11 +18,8 @@ struct merge_name_entry {
}; };
struct merge_index_with_status { struct merge_index_with_status {
uint16_t mode; struct merge_index_entry entry;
char oid_str[41]; unsigned int status;
int stage;
char path[128];
unsigned int status;
}; };
struct merge_reuc_entry { struct merge_reuc_entry {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment