gnustavo / Git-Hooks

Framework for implementing Git (and Gerrit) hooks
http://search.cpan.org/dist/Git-Hooks/
41 stars 17 forks source link

Problem, only first git diff-tree is checked #50

Closed stacyharper closed 6 years ago

stacyharper commented 6 years ago

I inspected a little bit and i found that :

sub check_commit {
    my ($git) = @_;

    _setup_config($git);

    my $current_branch = $git->get_current_branch();

    return 1 unless $git->is_reference_enabled($current_branch);

    return 0 == check_everything(
        $git,
        $current_branch,
        ':0',                   # mark to signify the index
        $git->run(qw/diff-index --name-status --ignore-submodules --no-commit-id --cached -r/,
                  $git->get_head_or_empty_tree));
}

do not work but

sub check_commit {
    my ($git) = @_;

    _setup_config($git);

    my $current_branch = $git->get_current_branch();

    return 1 unless $git->is_reference_enabled($current_branch);

    my $var = $git->run(qw/diff-index --name-status --ignore-submodules --no-commit-id --cached -r/, $git->get_head_or_empty_tree);

    return 0 == check_everything(
        $git,
        $current_branch,
        ':0',                   # mark to signify the index
        $var);
}

will...

It seems that the $extra variable in check_everything is not what the $git->run fetch.

Sorry for non additionnal informations, I do not have lot of time. Just want to repport this one.

gnustavo commented 6 years ago

Hi Eddie. Thank you very much for yet another bug report.

I fixed this one on commit e465e87.

I'll cut a new release soon.