/** * Loads the object * @param string $sha1 The hash of the object to load * @return Internal */ public function load($sha1) { return $this->io->readObject($sha1); }
/** * Writes the annotated tag to IO * @param IOInterface $io The IO to write to * @internal */ public function write(IOInterface $io) { $io->addObject($this); $this->object->write($io); }
/** * Removes a branch * @param Branch $branch The branch to remove */ public function removeBranch(Branch $branch) { $this->io->removeRef($branch->getHead()); }
/** * Writes the tree and all its linked objects to IO * @internal */ public function write(IOInterface $io) { $io->addObject($this); foreach ($this->objects as $object) { $object[0]->write($io); } }
/** * Writes the reference and the object it refers to to disk * @param \gihp\IO\IOInterface $io */ public function write(IOInterface $io) { $io->addRef($this); $this->commit->write($io); }
/** * Writes the branch to IO * @param IOInterface $io An IOInterface to write to */ public function write(IOInterface $io) { if (!$this->ref) { throw new \LogicException('Branch cannot be written if no head reference exists'); } try { $io->removeRef($this->ref); } catch (\RuntimeException $e) { //Nothing to worry about, the ref just does not exist. } $this->ref->write($io); }
/** * Writes the commit and its dependencies to IO * @internal */ public function write(IOInterface $io) { $io->addObject($this); foreach ($this->parents as $parent) { $parent->write($io); } $this->tree->write($io); }
/** * Loads the reference * @param string $path The path to the reference * @return Reference */ public function load($path) { return $this->io->readRef($path); }
/** * Writes the symbolic reference and the object it points to to disk * @param \gihp\IO\IOInterface $io */ public function write(\gihp\IO\IOInterface $io) { $io->moveHead($this); $this->head->write($io); }