Summary:
There was a bug in Git: https://github.com/git/git/commit/d9a935
Also fix a bug with discovering existing commits.
Test Plan:
$ arc diff # yes
# abort
$ arc diff # didn't see fatal
Reviewers: epriestley
Reviewed By: epriestley
CC: aran, Korvin
Maniphest Tasks: T2025
Differential Revision: https://secure.phabricator.com/D3983
const COMMIT_ALLOW = 1;
const COMMIT_ENABLE = 2;
+ const AUTO_COMMIT_TITLE = 'Automatic commit by arc';
+
private $commitMode = self::COMMIT_DISABLE;
private $shouldAmend;
$commit = head($api->getLocalCommitInformation());
$api->amendCommit($commit['message']);
} else if ($api->supportsRelativeLocalCommits()) {
- $api->doCommit('');
+ $api->doCommit(self::AUTO_COMMIT_TITLE);
}
}
}
$known_commits = $this->getConduit()->callMethodSynchronous(
'diffusion.getcommits',
array('commits' => array('r'.$callsign.$commit['commit'])));
- if ($known_commits) {
+ if (ifilter($known_commits, 'error', $negate = true)) {
return false;
}
}
$messages = array();
foreach ($local as $hash => $info) {
$text = $info['message'];
+ if (trim($text) == self::AUTO_COMMIT_TITLE) {
+ continue;
+ }
$obj = ArcanistDifferentialCommitMessage::newFromRawCorpus($text);
$messages[$hash] = $obj;
}
foreach ($usable as $message) {
// Pick the first line out of each message.
$text = trim($message);
+ if ($text == self::AUTO_COMMIT_TITLE) {
+ continue;
+ }
$text = head(explode("\n", $text));
$default[] = ' - '.$text."\n";
}