Code

Merge branch 'cb/maint-1.6.0-xdl-merge-fix' into maint
authorJunio C Hamano <gitster@pobox.com>
Tue, 2 Jun 2009 14:48:44 +0000 (07:48 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 2 Jun 2009 14:48:44 +0000 (07:48 -0700)
* 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

1  2 
t/t6023-merge-file.sh
xdiff/xmerge.c

Simple merge
diff --cc xdiff/xmerge.c
index d9737f04c220645aa762d79ff14a84855721ffda,1ef1d358cef61d546a3cbcb85afe5bb3d318f5a7..1cb65a95166a8cb60af590118f59d78aa4d24b74
@@@ -563,23 -470,22 +563,22 @@@ int xdl_merge(mmfile_t *orig, mmfile_t 
                return -1;
        }
        status = 0;
-       if (xscr1 || xscr2) {
-               if (!xscr1) {
-                       result->ptr = xdl_malloc(mf2->size);
-                       memcpy(result->ptr, mf2->ptr, mf2->size);
-                       result->size = mf2->size;
-               } else if (!xscr2) {
-                       result->ptr = xdl_malloc(mf1->size);
-                       memcpy(result->ptr, mf1->ptr, mf1->size);
-                       result->size = mf1->size;
-               } else {
-                       status = xdl_do_merge(&xe1, xscr1, name1,
-                                             &xe2, xscr2, name2,
-                                             flags, xpp, result);
-               }
-               xdl_free_script(xscr1);
-               xdl_free_script(xscr2);
+       if (!xscr1) {
+               result->ptr = xdl_malloc(mf2->size);
+               memcpy(result->ptr, mf2->ptr, mf2->size);
+               result->size = mf2->size;
+       } else if (!xscr2) {
+               result->ptr = xdl_malloc(mf1->size);
+               memcpy(result->ptr, mf1->ptr, mf1->size);
+               result->size = mf1->size;
+       } else {
+               status = xdl_do_merge(&xe1, xscr1, name1,
+                                     &xe2, xscr2, name2,
 -                                    level, xpp, result);
++                                    flags, xpp, result);
        }
+       xdl_free_script(xscr1);
+       xdl_free_script(xscr2);
        xdl_free_env(&xe1);
        xdl_free_env(&xe2);