HomePhabricator

Fix a PHP 8.1 repository marker issue in Mercurial

Description

Fix a PHP 8.1 repository marker issue in Mercurial

Summary:
Ref T13588. "arc-ls-markers" emits a "branch-state" marker so callers can identify which branch is active in the working copy.

This marker doesn't have an associated commit, so trying to generate a display name fails under stricter PHP 8.1 rules when we try to substr(null, ...).

Don't attempt to generate a display name for markers with no commit hash.

Test Plan:

  • Ran arc branches under PHP 8.1 in a Mercurial repository.
  • Before: fatal.
  • After: sensible output.

Maniphest Tasks: T13588

Differential Revision: https://secure.phabricator.com/D21825

Details

Provenance
epriestleyAuthored on May 17 2022, 11:15 PM
epriestleyPushed on May 17 2022, 11:20 PM
Differential Revision
D21825: Fix a PHP 8.1 repository marker issue in Mercurial
Parents
rARC942b54a6977a: Straggling fixes for PhutilURI under PHP 8.1
Branches
Unknown
Tags
Unknown
Tasks
T13588: PHP 8 Compatibility