+ $name = substr($name, 1, -1);
+ $name = str_replace('\"', '"', $name);
+ $name = preg_replace_callback(
+ '#\\\\[0-7]{3}#',
+ function ($ar) {
+ return chr(octdec(substr($ar[0], 1)));
+ },
+ $name
+ );
+ return $name;
+ }
+
+ /**
+ * Return array with all file paths in this repository
+ *
+ * @return array
+ */
+ protected function getFilePaths()
+ {
+ if ($this->hash === null) {
+ $hash = 'HEAD';
+ } else {
+ $hash = $this->hash;
+ }
+ $output = $this->getVc()->getCommand('ls-tree')
+ ->setOption('r')
+ ->setOption('name-only')
+ ->addArgument($hash)
+ ->execute();
+ $files = explode("\n", trim($output));
+ foreach ($files as &$file) {
+ if ($file{0} == '"') {
+ $file = $this->decodeFileName($file);
+ }