@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix an issue where we may "min()" an empty array when viewing a revision with no changesets

Summary:
Ref T13667. When a revision's diff has no changesets (usually because Diffusion performed an automatic update with an empty commit), the UI currently tries to "min()" an empty array and fatals.

Handle this case properly.

Test Plan:
- Created a revision with a diff with no changesets ("git commit --allow-empty" + copy-paste into web UI).
- Viewed revision.
- Before: "min()" fatal.
- After: UI isn't perfect, but works without fataling.

Subscribers: cspeckmim

Maniphest Tasks: T13667

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

+2 -4
+2 -4
src/infrastructure/diff/engine/PhabricatorInlineCommentAdjustmentEngine.php
··· 141 141 } 142 142 } 143 143 144 - // Find the smallest "new" changeset ID. We'll consider everything 145 - // larger than this to be "newer", and everything smaller to be "older". 146 - $first_new_id = min(mpull($new, 'getID')); 144 + $new_id_map = mpull($new, null, 'getID'); 147 145 148 146 $results = array(); 149 147 foreach ($inlines as $inline) { ··· 163 161 164 162 $target_id = null; 165 163 166 - if ($changeset_id >= $first_new_id) { 164 + if (isset($new_id_map[$changeset_id])) { 167 165 $name_map = $name_map_new; 168 166 $is_new = true; 169 167 } else {