mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-02-27 03:44:51 -05:00
git-notify: Ignore "empty" commits
Omit notifications regarding commits which don't change the tree whatsoever.
This commit is contained in:
parent
5445b9769f
commit
db63fbfa03
1 changed files with 6 additions and 4 deletions
|
|
@ -230,6 +230,12 @@ sub send_commit_notice($$)
|
||||||
my %info = get_object_info($obj);
|
my %info = get_object_info($obj);
|
||||||
my @notice = ();
|
my @notice = ();
|
||||||
|
|
||||||
|
open DIFF, "-|" or exec "git", "diff-tree", "-p", "-M", "--no-commit-id", $obj or die "cannot exec git-diff-tree";
|
||||||
|
my $diff = join("", <DIFF>);
|
||||||
|
close DIFF;
|
||||||
|
|
||||||
|
return if length($diff) == 0;
|
||||||
|
|
||||||
push @notice,
|
push @notice,
|
||||||
"Module: $repos_name",
|
"Module: $repos_name",
|
||||||
"Branch: $ref",
|
"Branch: $ref",
|
||||||
|
|
@ -247,10 +253,6 @@ sub send_commit_notice($$)
|
||||||
push @notice, join("", <STAT>);
|
push @notice, join("", <STAT>);
|
||||||
close STAT;
|
close STAT;
|
||||||
|
|
||||||
open DIFF, "-|" or exec "git", "diff-tree", "-p", "-M", "--no-commit-id", $obj or die "cannot exec git-diff-tree";
|
|
||||||
my $diff = join( "", <DIFF> );
|
|
||||||
close DIFF;
|
|
||||||
|
|
||||||
if (($max_diff_size == -1) || (length($diff) < $max_diff_size))
|
if (($max_diff_size == -1) || (length($diff) < $max_diff_size))
|
||||||
{
|
{
|
||||||
push @notice, $diff;
|
push @notice, $diff;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue