MCPcopy Index your code
hub / github.com/coder/coder / gitShow

Function gitShow

scripts/migrate-test/main.go:136–142  ·  view source on GitHub ↗
(path, version string)

Source from the content-addressed store, hash-verified

134}
135
136func gitShow(path, version string) ([]byte, error) {
137 out, err := exec.Command("git", "show", version+":"+path).CombinedOutput() //nolint:gosec
138 if err != nil {
139 return nil, xerrors.Errorf("git show: %s\n", out)
140 }
141 return out, nil
142}
143
144func stripGenPreamble(bs []byte) []byte {
145 return regexp.MustCompile(`(?im)^(-- Code generated.*DO NOT EDIT.)$`).ReplaceAll(bs, []byte{})

Callers 1

mainFunction · 0.85

Calls 2

CommandMethod · 0.80
ErrorfMethod · 0.45

Tested by

no test coverage detected