aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Cascio <keith@cs.ucla.edu>2009-02-16 18:59:00 -0800
committerJunio C Hamano <gitster@pobox.com>2009-03-04 00:56:51 -0800
commite752f4bba24afe964eb42d6c2b8bf06cc77c9ce4 (patch)
treedf34d7093c4deb2db45569c964d54837fcf84dcc
parent628d5c2b707db207e47c42ca112b182aa171cfaa (diff)
downloadgit-e752f4bba24afe964eb42d6c2b8bf06cc77c9ce4.tar.gz
git-e752f4bba24afe964eb42d6c2b8bf06cc77c9ce4.tar.xz
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>
-rw-r--r--builtin-checkout.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin-checkout.c b/builtin-checkout.c
index 20b34ce6e..c315f6339 100644
--- a/builtin-checkout.c
+++ b/builtin-checkout.c
@@ -295,6 +295,8 @@ static void show_local_changes(struct object *head)
init_revisions(&rev, NULL);
rev.abbrev = 0;
rev.diffopt.output_format |= DIFF_FORMAT_NAME_STATUS;
+ if (diff_setup_done(&rev.diffopt) < 0)
+ die("diff_setup_done failed");
add_pending_object(&rev, head, NULL);
run_diff_index(&rev, 0);
}