@matheusbsbs / matheus-bagliano / commits / f120ae2a8e
Fork 0

merge-recursive.c: mrtree in merge() is not used before set

The called function merge_trees() sets its *result, to which the address of the variable mrtree in merge() function is passed, only when index_only is set. But that is Ok as the function uses the value in the variable only under index_only iteration. However, recent gcc does not realize this. Work it around by adding a fake initializer. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Oct 29, 2007 at 12:00 UTC f120ae2a8e8cbe1bcbb2b55ebcd2e1eeb9f03ea2
1 file changed +1 -1
merge-recursive.c
+1 -1
@@ -1586,7 +1586,7 @@ static int merge(struct commit *h1,
1586 {
1587 struct commit_list *iter;
1588 struct commit *merged_common_ancestors;
1589 - struct tree *mrtree;
1589 + struct tree *mrtree = mrtree;
1590 int clean;
1591
1592 if (show(4)) {