Changeset View
Changeset View
Standalone View
Standalone View
src/repository/api/ArcanistGitAPI.php
Show First 20 Lines • Show All 1,747 Lines • ▼ Show 20 Lines | protected function newLandEngine() { | ||||
return new ArcanistGitLandEngine(); | return new ArcanistGitLandEngine(); | ||||
} | } | ||||
public function newLocalState() { | public function newLocalState() { | ||||
return id(new ArcanistGitLocalState()) | return id(new ArcanistGitLocalState()) | ||||
->setRepositoryAPI($this); | ->setRepositoryAPI($this); | ||||
} | } | ||||
public function readRawCommit($hash) { | |||||
list($stdout) = $this->execxLocal( | |||||
'cat-file commit -- %s', | |||||
$hash); | |||||
return ArcanistGitRawCommit::newFromRawBlob($stdout); | |||||
} | |||||
public function writeRawCommit(ArcanistGitRawCommit $commit) { | |||||
$blob = $commit->getRawBlob(); | |||||
$future = $this->execFutureLocal('hash-object -t commit --stdin -w'); | |||||
$future->write($blob); | |||||
list($stdout) = $future->resolvex(); | |||||
return trim($stdout); | |||||
} | |||||
} | } |