MCPcopy Index your code
hub / github.com/google/git-appraise / CreateCommitWithTree

Method CreateCommitWithTree

repository/git.go:658–665  ·  view source on GitHub ↗

CreateCommitWithTree creates a commit object with the given tree and returns its hash.

(details *CommitDetails, t *Tree)

Source from the content-addressed store, hash-verified

656
657// CreateCommitWithTree creates a commit object with the given tree and returns its hash.
658func (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`.

Callers

nothing calls this directly

Calls 3

StoreTreeMethod · 0.95
CreateCommitMethod · 0.95
ContentsMethod · 0.45

Tested by

no test coverage detected