summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-06-27 16:31:26 +0200
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-06-28 14:50:38 +0000
commit8980e505b5cdc8b6b9beb397887dc743dfc845c4 (patch)
treef2f6b7a4fc4faf72e48736bc861f556bfc73f1a5
parentc8035e6afde9e92f968e690aee3365a887b110c7 (diff)
make the size complaint less confusing for files right above the limit
"50KiB > 50KiB" is mathematically wrong, and is an artifact of the first number being rounded down. so instead complain about >= 50KiB. Change-Id: Idebaebcd7e1b432ea37dc2b0c9ed6d0705b47c92 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
-rwxr-xr-xgit-hooks/sanitize-commit4
1 files changed, 2 insertions, 2 deletions
diff --git a/git-hooks/sanitize-commit b/git-hooks/sanitize-commit
index 42b91d0..a90aabf 100755
--- a/git-hooks/sanitize-commit
+++ b/git-hooks/sanitize-commit
@@ -848,8 +848,8 @@ while (<DIFF>) {
if (!defined($cfg{giant})) {
complain("Adding huge file (".formatSize($size)." > 2MiB)", "giant", 1);
}
- } elsif ($size > 51200 && !$issrc && !defined($cfg{size})) {
- complain("Warning: Adding big file (".formatSize($size)." > 50KiB)", "size");
+ } elsif ($size >= 51200 && !$issrc && !defined($cfg{size})) {
+ complain("Warning: Adding big file (".formatSize($size)." >= 50KiB)", "size");
}
$size = 0;
$new_file = 1;