Cogit

 view release on metacpan or  search on metacpan

lib/Cogit.pm  view on Meta::CPAN

sub put_object {
   my ($self, $object, $ref) = @_;
   $self->loose->put_object($object);

   if ($object->kind eq 'commit') {
      $ref = 'master' unless $ref;
      $self->update_ref($ref, $object->sha1);
   }
}

sub update_ref {
   my ($self, $refname, $sha1) = @_;
   my $ref = file($self->gitdir, 'refs', 'heads', $refname);
   $ref->parent->mkpath;
   my $ref_fh = $ref->openw;
   $ref_fh->print($sha1) || die "Error writing to $ref";

   # FIXME is this always what we want?
   my $head = file($self->gitdir, 'HEAD');
   my $head_fh = $head->openw;
   $head_fh->print("ref: refs/heads/$refname")

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.494 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )