MCPcopy
hub / github.com/kptdev/kpt / GetCommit

Method GetCommit

internal/testutil/testutil.go:314–322  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

312}
313
314func (g *TestGitRepo) GetCommit() (string, error) {
315 cmd := exec.Command("git", "rev-parse", "--verify", "HEAD")
316 cmd.Dir = g.RepoDirectory
317 b, err := cmd.Output()
318 if err != nil {
319 return "", err
320 }
321 return strings.TrimSpace(string(b)), nil
322}
323
324// RemoveAll deletes the test git repo
325func (g *TestGitRepo) RemoveAll() error {

Callers 15

TestCmd_executeFunction · 0.80
TestCmd_executeFunction · 0.80
TestCommand_RunFunction · 0.80
TestCommand_Run_subdirFunction · 0.80
TestCommand_Run_branchFunction · 0.80
TestCommand_Run_tagFunction · 0.80
TestCommand_Run_cleanFunction · 0.80

Calls 1

CommandMethod · 0.45

Tested by 15

TestCmd_executeFunction · 0.64
TestCmd_executeFunction · 0.64
TestCommand_RunFunction · 0.64
TestCommand_Run_subdirFunction · 0.64
TestCommand_Run_branchFunction · 0.64
TestCommand_Run_tagFunction · 0.64
TestCommand_Run_cleanFunction · 0.64