Changeset View
Changeset View
Standalone View
Standalone View
src/repository/api/ArcanistGitAPI.php
| Show First 20 Lines • Show All 1,026 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| private function getFileDataAtRevision($path, $revision) { | private function getFileDataAtRevision($path, $revision) { | ||||
| // NOTE: We don't want to just "git show {$revision}:{$path}" since if the | // NOTE: We don't want to just "git show {$revision}:{$path}" since if the | ||||
| // path was a directory at the given revision we'll get a list of its files | // path was a directory at the given revision we'll get a list of its files | ||||
| // and treat it as though it as a file containing a list of other files, | // and treat it as though it as a file containing a list of other files, | ||||
| // which is silly. | // which is silly. | ||||
| if (!strlen($path)) { | |||||
| // No filename, so there's no content (Probably new/deleted file). | |||||
| return null; | |||||
| } | |||||
| list($stdout) = $this->execxLocal( | list($stdout) = $this->execxLocal( | ||||
| 'ls-tree %s -- %s', | 'ls-tree %s -- %s', | ||||
| $revision, | $revision, | ||||
| $path); | $path); | ||||
| $info = $this->parseGitTree($stdout); | $info = $this->parseGitTree($stdout); | ||||
| if (empty($info[$path])) { | if (empty($info[$path])) { | ||||
| // No such path, or the path is a directory and we executed 'ls-tree dir/' | // No such path, or the path is a directory and we executed 'ls-tree dir/' | ||||
| ▲ Show 20 Lines • Show All 506 Lines • Show Last 20 Lines | |||||