Skip to content

Commit

Permalink
Merge branch 'sb/merge-recursive-copy-paste-fix'
Browse files Browse the repository at this point in the history
"git merge-recursive" had a small bug that could have made it
mishandle "one side deleted, the other side did not touch it" in a
rare corner case, where the other side actually did touch to cause
the blob object names to be different but both blobs before and
after the change normalize to the same (e.g. correcting mistake to
check in a blob with CRLF line endings by replacing it with another
blob that records the same contents with LF line endings).

* sb/merge-recursive-copy-paste-fix:
  merge-recursive: remove stale commented debugging code
  merge-recursive: fix copy-paste mistake
  • Loading branch information
Junio C Hamano committed Sep 30, 2014
2 parents 131f031 + 040b2ac commit ab9bc95
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions merge-recursive.c
Original file line number Diff line number Diff line change
Expand Up @@ -1555,7 +1555,7 @@ static int blob_unchanged(const unsigned char *o_sha,
* unchanged since their sha1s have already been compared.
*/
if (renormalize_buffer(path, o.buf, o.len, &o) |
renormalize_buffer(path, a.buf, o.len, &a))
renormalize_buffer(path, a.buf, a.len, &a))
ret = (o.len == a.len && !memcmp(o.buf, a.buf, o.len));

error_return:
Expand Down Expand Up @@ -1686,10 +1686,6 @@ static int merge_content(struct merge_options *o,
static int process_entry(struct merge_options *o,
const char *path, struct stage_data *entry)
{
/*
printf("processing entry, clean cache: %s\n", index_only ? "yes": "no");
print_index_entry("\tpath: ", entry);
*/
int clean_merge = 1;
int normalize = o->renormalize;
unsigned o_mode = entry->stages[1].mode;
Expand Down

0 comments on commit ab9bc95

Please sign in to comment.