Skip to content

Commit ab9bc95

Browse files
committed
Merge branch 'sb/merge-recursive-copy-paste-fix'
"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
2 parents 131f031 + 040b2ac commit ab9bc95

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

merge-recursive.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,7 +1555,7 @@ static int blob_unchanged(const unsigned char *o_sha,
15551555
* unchanged since their sha1s have already been compared.
15561556
*/
15571557
if (renormalize_buffer(path, o.buf, o.len, &o) |
1558-
renormalize_buffer(path, a.buf, o.len, &a))
1558+
renormalize_buffer(path, a.buf, a.len, &a))
15591559
ret = (o.len == a.len && !memcmp(o.buf, a.buf, o.len));
15601560

15611561
error_return:
@@ -1686,10 +1686,6 @@ static int merge_content(struct merge_options *o,
16861686
static int process_entry(struct merge_options *o,
16871687
const char *path, struct stage_data *entry)
16881688
{
1689-
/*
1690-
printf("processing entry, clean cache: %s\n", index_only ? "yes": "no");
1691-
print_index_entry("\tpath: ", entry);
1692-
*/
16931689
int clean_merge = 1;
16941690
int normalize = o->renormalize;
16951691
unsigned o_mode = entry->stages[1].mode;

0 commit comments

Comments
 (0)