예제 #1
0
파일: add.php 프로젝트: curseoff/pgit
 public function run()
 {
     $this->error->repository_exists();
     $file = new \Pgit\Lib\File();
     $working_files = $file->working_files();
     $add_filename = isset($this->commands[1]) ? $this->commands[1] : null;
     if (!$add_filename) {
         echo "Nothing specified, nothing added.\nMaybe you wanted to say 'pgit add .'?\n";
         exit;
     }
     if (!in_array($add_filename, $working_files)) {
         echo sprintf("fatal: pathspec '%s' did not match any files\n", $add_filename);
         exit;
     }
     $blob = new \Pgit\Lib\Blob();
     $sha1 = $blob->create($add_filename);
 }
예제 #2
0
파일: cat_file.php 프로젝트: curseoff/pgit
 public function run()
 {
     $sha1 = $this->commands[1];
     $blob = new \Pgit\Lib\Blob();
     echo $blob->get($sha1);
 }