Beispiel #1
0
func (s *DiffTreeSuite) commitFromStorer(c *C, sto storer.EncodedObjectStorer,
	h plumbing.Hash) *object.Commit {

	commit, err := object.GetCommit(sto, h)
	c.Assert(err, IsNil)
	return commit
}
Beispiel #2
0
func commitsToPush(s storer.EncodedObjectStorer, commands []*packp.Command) ([]*object.Commit, error) {
	var commits []*object.Commit
	for _, cmd := range commands {
		if cmd.New == plumbing.ZeroHash {
			continue
		}

		c, err := object.GetCommit(s, cmd.New)
		if err != nil {
			return nil, err
		}

		commits = append(commits, c)
	}

	return commits, nil
}
Beispiel #3
0
func (s *RevListSuite) commit(c *C, h plumbing.Hash) *object.Commit {
	commit, err := object.GetCommit(s.Storer, h)
	c.Assert(err, IsNil)
	return commit
}