Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F89633
D7756.diff
All Users
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D7756.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D7756: Fix fatal in Git hook when a --force push completely rewrites a ref
Attached
Detach File
Event Timeline
Log In to Comment