MCPcopy
hub / github.com/git-lfs/git-lfs / EmptyTree

Function EmptyTree

git/git.go:150–164  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

148}
149
150func EmptyTree() (string, error) {
151 emptyTreeMutex.Lock()
152 defer emptyTreeMutex.Unlock()
153
154 if len(emptyTree) == 0 {
155 cmd, err := gitNoLFS("hash-object", "-t", "tree", "/dev/null")
156 if err != nil {
157 return "", errors.New(tr.Tr.Get("failed to find `git hash-object`: %v", err))
158 }
159 cmd.Stdin = nil
160 out, _ := cmd.Output()
161 emptyTree = strings.TrimSpace(string(out))
162 }
163 return emptyTree, nil
164}
165
166// Some top level information about a commit (only first line of message)
167type CommitSummary struct {

Callers 2

lsFilesCommandFunction · 0.92
statusCommandFunction · 0.92

Calls 6

NewFunction · 0.92
gitNoLFSFunction · 0.85
LockMethod · 0.65
UnlockMethod · 0.65
GetMethod · 0.65
OutputMethod · 0.45

Tested by

no test coverage detected