summaryrefslogtreecommitdiff
path: root/gitConfig.go
diff options
context:
space:
mode:
Diffstat (limited to 'gitConfig.go')
-rw-r--r--gitConfig.go27
1 files changed, 26 insertions, 1 deletions
diff --git a/gitConfig.go b/gitConfig.go
index 70568bb..fcdb7ec 100644
--- a/gitConfig.go
+++ b/gitConfig.go
@@ -105,7 +105,7 @@ func readGitConfig(filePath string) (*GitConfig, error) {
if len(parts) == 2 {
line = strings.Trim(line, "[]")
- currentName = strings.Trim(parts[1], "[]")
+ currentName = strings.Trim(parts[1], "\"")
}
continue
}
@@ -116,7 +116,10 @@ func readGitConfig(filePath string) (*GitConfig, error) {
}
key := strings.TrimSpace(partsNew[0])
+ key = strings.TrimSuffix(key, "\"")
+
value := strings.TrimSpace(partsNew[1])
+ value = strings.TrimSuffix(value, "\"")
switch currentSection {
case "core":
@@ -233,3 +236,25 @@ func (rs *RepoStatus) ReadGoMod() bool {
rs.goConfig = deps
return true
}
+
+func ScanGoSrc() {
+ log.Log(WARN, "Scanning all go.sum files")
+ for path, rs := range windowMap {
+ if rs.ReadGoMod() {
+ // everything is ok
+ } else {
+ log.Log(WARN, "failed reading go.sum repo:", path)
+ }
+ }
+}
+
+func ScanGitConfig() {
+ for i, path := range listGitDirectories() {
+ filename := filepath.Join(path, ".git/config")
+ _, err := readGitConfig(filename)
+ if err != nil {
+ log.Log(WARN, "repo =", i, path)
+ log.Log(WARN, "Error reading .git/config:", err)
+ }
+ }
+}