changed the pre-commit hook for old perls

This commit is contained in:
hyung-hwan 2015-02-16 02:32:32 +00:00
parent fe6921fbed
commit 63d0c15ef9

View File

@ -343,9 +343,22 @@ sub restrict_changes_in_directory
return -1;
}
my $root = $txn->root();
my $paths_changed = $root->paths_changed();
foreach my $affected_file(keys $paths_changed)
my $root = eval { $txn->root() };
if (!defined($root))
{
print (STDERR "Cannot open root of transaction - $TRANSACTION\n");
return -1;
}
my $paths_changed = eval { $root->paths_changed() };
if (!defined($paths_changed))
{
# no change information found. return ok
$root->close_root ();
return 0;
}
foreach my $affected_file(keys %$paths_changed)
{
my $chg = $paths_changed->{$affected_file};
my $action = $chg->change_kind();