MCPcopy Create free account
hub / github.com/dirk/quickhook / FilesToBeCommitted

Method FilesToBeCommitted

repo/git.go:9–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7)
8
9func (repo *Repo) FilesToBeCommitted() ([]string, error) {
10 span := tracing.NewSpan("git diff")
11 defer span.End()
12 lines, err := repo.ExecCommandLines("git", "diff", "--name-only", "--cached")
13 if err != nil {
14 return nil, err
15 }
16 return lo.Filter(lines, func(line string, index int) bool {
17 isFile, _ := repo.isFile(line)
18 return isFile
19 }), err
20}

Callers 1

RunMethod · 0.80

Calls 4

EndMethod · 0.95
ExecCommandLinesMethod · 0.95
isFileMethod · 0.95
NewSpanFunction · 0.92

Tested by

no test coverage detected