INNER CODE UNIT · Go

gitTrackedPaths

streamnative/function-mesh · license_test.go:159

func gitTrackedPaths() (map[string]struct{}, map[string]struct{}) {
	cmd := exec.Command("git", "ls-files", "-z")
	output, err := cmd.Output()
	if err != nil {
		return nil, nil
	}

	files := make(map[string]struct{})
	dirs := map[string]struct{}{
		".": {},
	}

	for _, file := range strings.Split(string(output), "\x00") {
		if file == "" {
			continue
		}

		cleanFile := filepath.Clean(file)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…