(repoDir, line string)
| 112 | } |
| 113 | |
| 114 | func 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. |
| 144 | func GetCommitHash(repoDir string) (string, error) { |
no test coverage detected