Merge branch 'cb/maint-1.6.0-xdl-merge-fix' into maint

* cb/maint-1.6.0-xdl-merge-fix:
  Change xdl_merge to generate output even for null merges
  t6023: merge-file fails to output anything for a degenerate merge

Conflicts:
	xdiff/xmerge.c
This commit is contained in:
Junio C Hamano 2009-06-02 07:48:44 -07:00
commit 456cb4cf3e
2 changed files with 21 additions and 16 deletions

View File

@ -54,6 +54,12 @@ deduxit me super semitas jusitiae,
EOF
printf "propter nomen suum." >> new4.txt
test_expect_success 'merge with no changes' '
cp orig.txt test.txt &&
git merge-file test.txt orig.txt orig.txt &&
test_cmp test.txt orig.txt
'
cp new1.txt test.txt
test_expect_success "merge without conflict" \
"git merge-file test.txt orig.txt new2.txt"

View File

@ -563,7 +563,6 @@ int xdl_merge(mmfile_t *orig, mmfile_t *mf1, const char *name1,
return -1;
}
status = 0;
if (xscr1 || xscr2) {
if (!xscr1) {
result->ptr = xdl_malloc(mf2->size);
memcpy(result->ptr, mf2->ptr, mf2->size);
@ -579,7 +578,7 @@ int xdl_merge(mmfile_t *orig, mmfile_t *mf1, const char *name1,
}
xdl_free_script(xscr1);
xdl_free_script(xscr2);
}
xdl_free_env(&xe1);
xdl_free_env(&xe2);