MCPcopy Create free account
hub / github.com/remotemobprogramming/mob / gitStatus

Function gitStatus

mob_test.go:2025–2041  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2023}
2024
2025func gitStatus() GitStatus {
2026 shortStatus := silentgit("status", "--porcelain")
2027 statusLines := strings.Split(shortStatus, "\n")
2028 var statusMap = make(GitStatus)
2029 for _, line := range statusLines {
2030 if len(line) == 0 {
2031 continue
2032 }
2033 fields := strings.Fields(line)
2034 file := strings.Join(fields[1:], " ")
2035 if strings.HasPrefix(file, "\"") {
2036 file, _ = strconv.Unquote(file)
2037 }
2038 statusMap[file] = fields[0]
2039 }
2040 return statusMap
2041}
2042
2043func setup(t *testing.T) (output *string, configuration config.Configuration) {
2044 configuration = config.GetDefaultConfiguration()

Callers 5

TestEmptyGitStatusFunction · 0.85
TestGitStatusWithOneFileFunction · 0.85
assertGitStatusFunction · 0.85
assertCleanGitStatusFunction · 0.85

Calls 1

silentgitFunction · 0.85

Tested by

no test coverage detected