Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15311820
D19391.id46385.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D19391.id46385.diff
View Options
diff --git a/src/applications/diffusion/controller/DiffusionBlameController.php b/src/applications/diffusion/controller/DiffusionBlameController.php
--- a/src/applications/diffusion/controller/DiffusionBlameController.php
+++ b/src/applications/diffusion/controller/DiffusionBlameController.php
@@ -80,7 +80,6 @@
$handles = $viewer->loadHandles($handle_phids);
-
$map = array();
$epochs = array();
foreach ($identifiers as $identifier) {
@@ -106,9 +105,21 @@
),
$skip_icon);
- $commit = $commits[$identifier];
+ // We may not have a commit object for a given identifier if the commit
+ // has not imported yet.
+
+ // At time of writing, this can also happen if a line was part of the
+ // initial import: blame produces a "^abc123" identifier in Git, which
+ // doesn't correspond to a real commit.
+
+ $commit = idx($commits, $identifier);
+
+ $author_phid = null;
+
+ if ($commit) {
+ $author_phid = $commit->getAuthorPHID();
+ }
- $author_phid = $commit->getAuthorPHID();
if (!$author_phid && $revision) {
$author_phid = $revision->getAuthorPHID();
}
@@ -141,18 +152,22 @@
'meta' => $author_meta,
));
- $commit_link = javelin_tag(
- 'a',
- array(
- 'href' => $commit->getURI(),
- 'sigil' => 'has-tooltip',
- 'meta' => array(
- 'tip' => $this->renderCommitTooltip($commit, $handles),
- 'align' => 'E',
- 'size' => 600,
+ if ($commit) {
+ $commit_link = javelin_tag(
+ 'a',
+ array(
+ 'href' => $commit->getURI(),
+ 'sigil' => 'has-tooltip',
+ 'meta' => array(
+ 'tip' => $this->renderCommitTooltip($commit, $handles),
+ 'align' => 'E',
+ 'size' => 600,
+ ),
),
- ),
- $commit->getLocalName());
+ $commit->getLocalName());
+ } else {
+ $commit_link = null;
+ }
$info = array(
$author_link,
@@ -180,7 +195,12 @@
);
}
- $epoch = $commit->getEpoch();
+ if ($commit) {
+ $epoch = $commit->getEpoch();
+ } else {
+ $epoch = 0;
+ }
+
$epochs[] = $epoch;
$data = array(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 7, 11:27 AM (2 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7309132
Default Alt Text
D19391.id46385.diff (2 KB)
Attached To
Mode
D19391: Fix a fatal in the document engine blame view with files that blame to the initial commit
Attached
Detach File
Event Timeline
Log In to Comment