1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-05 23:27:01 +02:00

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: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
brian m. carlson 2018-05-02 00:26:09 +00:00 committed by Junio C Hamano
parent 03a7f388da
commit 23ec4c51d5

View File

@ -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 {