MCPcopy Create free account
hub / github.com/alibaba/open-code-review / untrackedFilesList

Method untrackedFilesList

internal/diff/git.go:321–338  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

319}
320
321func (p *Provider) untrackedFilesList(ctx context.Context) ([]string, error) {
322 out, err := p.runGit(ctx, "-c", "core.quotepath=false", "ls-files", "--others", "--exclude-standard")
323 if err != nil || out == "" {
324 return nil, nil
325 }
326 patterns := p.loadGitignorePatterns()
327 var files []string
328 for _, line := range strings.Split(strings.TrimSpace(out), "\n") {
329 line = strings.TrimSpace(line)
330 if line == "" {
331 continue
332 }
333 if !p.isPathExcluded(line, patterns) {
334 files = append(files, line)
335 }
336 }
337 return files, nil
338}
339
340func (p *Provider) runGit(ctx context.Context, args ...string) (string, error) {
341 if p.runner != nil {

Callers 1

untrackedFileDiffsMethod · 0.95

Calls 3

runGitMethod · 0.95
loadGitignorePatternsMethod · 0.95
isPathExcludedMethod · 0.95

Tested by

no test coverage detected