提交 23ec4c51 编写于 作者: B brian m. carlson 提交者: Junio C Hamano

add--interactive: compute the empty tree value

The interactive add script hard-codes the object ID of the empty tree.
To avoid any problems when changing hashes, compute this value when used
and cache it for any future uses.
Signed-off-by: Nbrian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 03a7f388
......@@ -205,8 +205,15 @@ sub list_untracked {
}
}
sub get_empty_tree {
return '4b825dc642cb6eb9a060e54bf8d69288fbee4904';
{
my $empty_tree;
sub get_empty_tree {
return $empty_tree if defined $empty_tree;
$empty_tree = run_cmd_pipe(qw(git hash-object -t tree /dev/null));
chomp $empty_tree;
return $empty_tree;
}
}
sub get_diff_reference {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册