Exemple #1
0
 public function createBlobNode()
 {
     $blob_node = new BlobNode();
     $blob_node->setBlob($this->getBlob());
     $blob_node->setIntegerMode($this->getMode());
     return $blob_node;
 }
Exemple #2
0
 public function hydrate(RawObject $raw_object)
 {
     $tree = new Tree();
     $tree->setSha($raw_object->getSha());
     $reader = new StringReader($raw_object->getData());
     while ($reader->available()) {
         $mode = intval($this->readModeString($reader), 8);
         $name = $this->readName($reader);
         $sha = $reader->readHHex(20);
         $is_tree = (bool) ($mode & 040000);
         if ($is_tree) {
             $node = new Node\TreeNode();
             $node->setTree(new TreeProxy($this->repo, $sha));
         } else {
             $node = new Node\BlobNode();
             $node->setBlob(new BlobProxy($this->repo, $sha));
         }
         $node->setIntegerMode($mode);
         $node->setName($name);
         $tree->addNode($node);
     }
     return $tree;
 }