MCPcopy Create free account
hub / github.com/celer-pkg/celer / shouldIgnoreStatusLine

Function shouldIgnoreStatusLine

pkgs/git/local.go:114–141  ·  view source on GitHub ↗
(repoDir, line string)

Source from the content-addressed store, hash-verified

112}
113
114func shouldIgnoreStatusLine(repoDir, line string) bool {
115 if !strings.HasPrefix(line, "?? ") {
116 return false
117 }
118
119 path := strings.TrimSpace(line[3:])
120 path = strings.Trim(path, "\"")
121 path = strings.TrimSuffix(filepath.ToSlash(path), "/")
122 if !strings.HasPrefix(path, "subprojects/") {
123 return false
124 }
125
126 base := filepath.Base(path)
127 if base == ".wraplock" || strings.HasSuffix(base, ".wrap") {
128 return true
129 }
130
131 absPath := filepath.Join(repoDir, filepath.FromSlash(path))
132 if pathExists(filepath.Join(absPath, ".git")) || pathExists(filepath.Join(absPath, ".meson-subproject-wrap-hash.txt")) {
133 return true
134 }
135
136 if pathExists(filepath.Join(repoDir, "subprojects", base+".wrap")) {
137 return true
138 }
139
140 return false
141}
142
143// GetCommitHash read git commit hash.
144func GetCommitHash(repoDir string) (string, error) {

Callers 1

statusLinesFunction · 0.85

Calls 1

pathExistsFunction · 0.70

Tested by

no test coverage detected