| 148 | } |
| 149 | |
| 150 | func 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) |
| 167 | type CommitSummary struct { |