CreateCommitWithTree creates a commit object with the given tree and returns its hash.
(details *CommitDetails, t *Tree)
| 656 | |
| 657 | // CreateCommitWithTree creates a commit object with the given tree and returns its hash. |
| 658 | func (repo *GitRepo) CreateCommitWithTree(details *CommitDetails, t *Tree) (string, error) { |
| 659 | treeHash, err := repo.StoreTree(t.Contents()) |
| 660 | if err != nil { |
| 661 | return "", fmt.Errorf("failure storing a tree: %v", err) |
| 662 | } |
| 663 | details.Tree = treeHash |
| 664 | return repo.CreateCommit(details) |
| 665 | } |
| 666 | |
| 667 | // SetRef sets the commit pointed to by the specified ref to `newCommitHash`, |
| 668 | // iff the ref currently points `previousCommitHash`. |
nothing calls this directly
no test coverage detected