Example #1
0
 /**
  * Gets the SHA1 hash of the object
  * @return sting
  */
 public function getSHA1()
 {
     if (!$this->sha1) {
         $this->sha1 = sha1(\gihp\Parser\File::exportObject($this));
     }
     return $this->sha1;
 }
Example #2
0
 public function readHead()
 {
     $file = $this->path . '/HEAD';
     if (!is_file($file)) {
         throw new \RuntimeException('HEAD not found');
     }
     $data = file_get_contents($file);
     return \gihp\Parser\File::importSymRef($this, $data);
 }