MCPcopy
hub / github.com/go-git/go-git / canonicalCommit

Function canonicalCommit

tests/objectverify/commit_test.go:144–152  ·  view source on GitHub ↗

canonicalCommit returns the byte-exact unsigned commit body produced by upstream `git commit-tree` for a single-parent commit. Used as the baseline; individual scenarios mutate the header lines around it.

()

Source from the content-addressed store, hash-verified

142// upstream `git commit-tree` for a single-parent commit. Used as the
143// baseline; individual scenarios mutate the header lines around it.
144func canonicalCommit() (headers []string, message string) {
145 return []string{
146 "tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904",
147 "parent 1111111111111111111111111111111111111111",
148 "author Test Author <author@example.local> 1700000000 +0000",
149 "committer Test Committer <committer@example.local> 1700000000 +0000",
150 },
151 "signed commit message\n"
152}
153
154func assembleCommit(headers []string, message string) []byte {
155 var buf bytes.Buffer

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…