Page MenuHomePhorge

Fix InvalidArgumentException on commit hook
AbandonedPublic

Authored by valerio.bozzolan on Apr 14 2023, 12:03.

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