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

Fix neglect of diff_setup()/diff_setup_done() symmetry.

Code that calls diff_setup(), including via init_revisions(), should later call diff_setup_done(), possibly via setup_revisions(). Failure to do so could cause errors, especially in the future when we add responsibilities to diff_setup_done(). This instance causes no known errors with the present code. But it resulted in an error with an experimental patch. Signed-off-by: Keith Cascio <keith@cs.ucla.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Keith Cascio committed Feb 16, 2009 at 18:59 UTC e752f4bba24afe964eb42d6c2b8bf06cc77c9ce4
1 file changed +2
builtin-checkout.c
+2
@@ -295,6 +295,8 @@ static void show_local_changes(struct object *head)
295 init_revisions(&rev, NULL);
296 rev.abbrev = 0;
297 rev.diffopt.output_format |= DIFF_FORMAT_NAME_STATUS;
298 + if (diff_setup_done(&rev.diffopt) < 0)
299 + die("diff_setup_done failed");
300 add_pending_object(&rev, head, NULL);
301 run_diff_index(&rev, 0);
302 }