Page MenuHomePhabricator

D7756.diff

diff --git a/src/applications/diffusion/engine/DiffusionCommitHookEngine.php b/src/applications/diffusion/engine/DiffusionCommitHookEngine.php
--- a/src/applications/diffusion/engine/DiffusionCommitHookEngine.php
+++ b/src/applications/diffusion/engine/DiffusionCommitHookEngine.php
@@ -256,8 +256,19 @@
}
foreach (Futures($futures)->limit(8) as $key => $future) {
- list($stdout) = $future->resolvex();
- $updates[$key]['merge-base'] = rtrim($stdout, "\n");
+
+ // If 'old' and 'new' have no common ancestors (for example, a force push
+ // which completely rewrites a ref), `git merge-base` will exit with
+ // an error and no output. It would be nice to find a positive test
+ // for this instead, but I couldn't immediately come up with one. See
+ // T4224. Assume this means there are no ancestors.
+
+ list($err, $stdout) = $future->resolve();
+ if ($err) {
+ $updates[$key]['merge-base'] = null;
+ } else {
+ $updates[$key]['merge-base'] = rtrim($stdout, "\n");
+ }
}
return $updates;

File Metadata

Mime Type
text/x-diff
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/rq/vc/62n3h6t7wwp6ual3
Default Alt Text
D7756.diff (1 KB)

Event Timeline