code: func GetTrackedFiles(pattern string) ([]string, error) {
  	safePattern := sanitizePattern(pattern)
  	rootWildcard := len(safePattern) < len(pattern) && strings.ContainsRune(safePattern, '*')
  
  	var ret []string
  	cmd := gitNoLFS(
  		"-c", "core.quotepath=false", // handle special chars in filenames
  		"ls-files",
  		"--cached", // include things which are staged but not committed right now
  		"--",       // no ambiguous patterns
  		safePattern)
  
  	outp, err := cmd.StdoutPipe()
  	if err != nil {
  		return nil, fmt.Errorf("Failed to call git ls-files: %v", err)
  	}
  	cmd.Start()
  	scanner := bufio.NewScanner(outp)
  	for scanner.Scan() {
  		line := scanner.Text()
  
  		// If the given pattern is a root wildcard, skip all files which
  		// are not direct descendants of the repository's root.
  		//
  		// This matches the behavior of how .gitattributes performs
  		// filename matches.
  		if rootWildcard && filepath.Dir(line) != "." {
  			continue
  		}
  
  		ret = append(ret, strings.TrimSpace(line))
  	}
  	return ret, cmd.Wait()
  }
docs: // GetTrackedFiles returns a list of files which are tracked in Git which match
  // the pattern specified (standard wildcard form)
  // Both pattern and the results are relative to the current working directory, not
  // the root of the repository