Page MenuHomePhorge

Fix InvalidArgumentException on commit hook
AbandonedPublic

Authored by valerio.bozzolan on Apr 14 2023, 12:03.
Tags
None
Referenced Files
F2991858: D25121.1740196960.diff
Fri, Feb 21, 04:02
F2983683: D25121.1739996033.diff
Tue, Feb 18, 20:13
F2963216: D25121.1739203614.diff
Sun, Feb 9, 16:06
F2963215: D25121.1739203611.diff
Sun, Feb 9, 16:06
F2961736: D25121.1739169962.diff
Sun, Feb 9, 06:46
F2937146: D25121.1737948049.diff
Sun, Jan 26, 03:20
F2920874: D25121.1737552714.diff
Jan 21 2025, 13:31
F2905309: D25121.1737342512.diff
Jan 19 2025, 03:08

Details

Reviewers
None
Group Reviewers
O1: Blessed Committers
Summary

Fix a regression introduced here:

96ae4ba13acbf0e2f8932e950a92af0495f034d7

I reproduced this exception while using Subversion commit on a hosted
repository.

That crash happened because the PHP getenv() function can return false.
But, that is a very terrible value that blasts the non-string-empty check.

We know. Ideally, that check should just says "hey, nope, this is not a
non-empty string" - but - at the moment that check explodes so violently
for non-strings.

So, now the default getenv() value is skipped, without causing problems.

Test Plan
  • run one simple svn commit

Diff Detail

Repository
rP Phorge
Branch
fix-git-commit-hook
Lint
Lint Warnings
SeverityLocationCodeMessage
Warningscripts/repository/commit_hook.php:194TXT3Line Too Long
Unit
No Test Coverage
Build Status
Buildable 245
Build 245: arc lint + arc unit