summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 85512d7)
raw | patch | inline | side by side (parent: 85512d7)
author | Holger Weiss <holger@zedat.fu-berlin.de> | |
Sat, 24 Oct 2009 20:55:44 +0000 (22:55 +0200) | ||
committer | Holger Weiss <holger@zedat.fu-berlin.de> | |
Sat, 24 Oct 2009 20:55:44 +0000 (22:55 +0200) |
Properly check the exit status of all processes we execute and abort on
error.
error.
tools/git-notify | patch | blob | history |
diff --git a/tools/git-notify b/tools/git-notify
index b10b1bc4d44ca850c76c8a81d73cadad8dff0989..4a0faa5f8c9dce39ffb4652d1309af8f9973a7a1 100755 (executable)
--- a/tools/git-notify
+++ b/tools/git-notify
}
binmode MAIL, ":utf8";
print MAIL join("\n", @text), "\n";
- close MAIL;
+ close MAIL or die $! ? "Cannot execute $mailer: $!" : "$mailer exited with status: $?";
}
}
$info{$1 . "_tz"} = $6;
}
}
- close OBJ;
+ close OBJ or die $! ? "Cannot execute cat-file: $!" : "cat-file exited with status: $?";
$info{"log"} = \@log;
return %info;
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;
+ close DIFF or die $! ? "Cannot execute diff-tree: $!" : "diff-tree exited with status: $?";
return if length($diff) == 0;
open STAT, "-|" or exec "git", "diff-tree", "--stat", "-M", "--no-commit-id", $obj or die "cannot exec git-diff-tree";
push @notice, join("", <STAT>);
- close STAT;
+ close STAT or die $! ? "Cannot execute diff-tree: $!" : "diff-tree exited with status: $?";
if (($max_diff_size == -1) || (length($diff) < $max_diff_size))
{
push @cia_text, " <file action=\"rename\" to=\"" . xml_escape($new) . "\">" . xml_escape($old) . "</file>";
}
}
- close COMMIT;
+ close COMMIT or die $! ? "Cannot execute diff-tree: $!" : "diff-tree exited with status: $?";
push @cia_text,
" </files>",