diff options
Diffstat (limited to 'gitConfig.go')
| -rw-r--r-- | gitConfig.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gitConfig.go b/gitConfig.go index 389b028..e8c4c4b 100644 --- a/gitConfig.go +++ b/gitConfig.go @@ -2,6 +2,7 @@ package repostatus import ( "bufio" + "io/ioutil" "os" "path/filepath" "strings" @@ -32,7 +33,7 @@ type GitConfig struct { versions map[string]string } -type GoConfig map[string]string +// type GoConfig map[string]string func ListGitDirectories() []string { var all []string @@ -253,11 +254,13 @@ func (rs *RepoStatus) processBranch(branch string) { hash, ok := rs.gitConfig.hashes[branch] filename := fullpath + "/.git/refs/heads/" + branch log.Log(INFO, " hash: need to open", filename) - newhash, err := readFileToString(filename) + + data, err := ioutil.ReadFile(filename) if err != nil { log.Log(WARN, "hash: read failed", filename, rs.String()) return } + newhash := strings.TrimSpace(string(data)) log.Log(INFO, " hash:", newhash) rs.gitConfig.hashes[branch] = newhash if ok { |
