提交 e752f4bb 编写于 作者: K Keith Cascio 提交者: Junio C Hamano

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: NKeith Cascio <keith@cs.ucla.edu>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 628d5c2b
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册