Page MenuHomePhabricator

D10734.diff
No OneTemporary

D10734.diff

diff --git a/src/applications/audit/editor/PhabricatorAuditEditor.php b/src/applications/audit/editor/PhabricatorAuditEditor.php
--- a/src/applications/audit/editor/PhabricatorAuditEditor.php
+++ b/src/applications/audit/editor/PhabricatorAuditEditor.php
@@ -522,6 +522,14 @@
protected function shouldSendMail(
PhabricatorLiskDAO $object,
array $xactions) {
+
+ // not every code path loads the repository so tread carefully
+ if ($object->getRepository($assert_attached = false)) {
+ $repository = $object->getRepository();
+ if ($repository->isImporting()) {
+ return false;
+ }
+ }
return $this->isCommitMostlyImported($object);
}
@@ -803,7 +811,7 @@
protected function shouldPublishFeedStory(
PhabricatorLiskDAO $object,
array $xactions) {
- return $this->isCommitMostlyImported($object);
+ return $this->shouldSendMail($object, $xactions);
}
protected function shouldApplyHeraldRules(
diff --git a/src/applications/repository/storage/PhabricatorRepositoryCommit.php b/src/applications/repository/storage/PhabricatorRepositoryCommit.php
--- a/src/applications/repository/storage/PhabricatorRepositoryCommit.php
+++ b/src/applications/repository/storage/PhabricatorRepositoryCommit.php
@@ -40,8 +40,11 @@
return $this;
}
- public function getRepository() {
- return $this->assertAttached($this->repository);
+ public function getRepository($assert_attached = true) {
+ if ($assert_attached) {
+ return $this->assertAttached($this->repository);
+ }
+ return $this->repository;
}
public function isPartiallyImported($mask) {
diff --git a/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php b/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php
--- a/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php
+++ b/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php
@@ -17,7 +17,9 @@
$data = new PhabricatorRepositoryCommitData();
}
$data->setCommitID($commit->getID());
- $data->setAuthorName((string)$author);
+ $data->setAuthorName(id(new PhutilUTF8StringTruncator())
+ ->setMaximumCodepoints(255)
+ ->truncateString((string)$author));
$data->setCommitDetail('authorName', $ref->getAuthorName());
$data->setCommitDetail('authorEmail', $ref->getAuthorEmail());

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 19, 8:31 AM (1 h, 45 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6731893
Default Alt Text
D10734.diff (2 KB)

Event Timeline