@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.

Possibly fix issue where refs engine finds empty refs?

Summary:
@mbishopim3 reported an issue in IRC:

> mbishopim3: epriestley: "Error updating working copy: Commit "" has not been discovered yet! Run discovery before updating refs." any ideas?

I can't reproduce it and it went away for him, but one theory is that we're getting here and git/hg are spitting out nothing, which we incorrectly parse as `array("")` when we intend `array()`.

Test Plan:
Pushed some new commits, ran `bin/repositoy refs X`, got expected results.

I can't actually reproduce the bug, but this might fix it and appears to make the code more correct.

Reviewers: btrahan

Reviewed By: btrahan

CC: mbishopim3, aran

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

+10
+10
src/applications/repository/engine/PhabricatorRepositoryRefEngine.php
··· 247 247 '{node}\n', 248 248 hgsprintf('%s', $new_head)); 249 249 } 250 + 251 + $stdout = trim($stdout); 252 + if (!strlen($stdout)) { 253 + return array(); 254 + } 250 255 return phutil_split_lines($stdout, $retain_newlines = false); 251 256 case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT: 252 257 if ($all_closing_heads) { ··· 260 265 'log --format=%s %s', 261 266 '%H', 262 267 $new_head); 268 + } 269 + 270 + $stdout = trim($stdout); 271 + if (!strlen($stdout)) { 272 + return array(); 263 273 } 264 274 return phutil_split_lines($stdout, $retain_newlines = false); 265 275 default: