summaryrefslogtreecommitdiff
path: root/stat.updateRefs.go
diff options
context:
space:
mode:
Diffstat (limited to 'stat.updateRefs.go')
-rw-r--r--stat.updateRefs.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/stat.updateRefs.go b/stat.updateRefs.go
index 4676fe9..84f95f9 100644
--- a/stat.updateRefs.go
+++ b/stat.updateRefs.go
@@ -46,18 +46,23 @@ func (r *Repo) UpdateRefs(stats *Stats) error {
log.Printf("LINE:%v %d %s\n", parts, counter, r.FullPath)
}
newstat := new(Stat)
- newstat.Hash = parts[0]
- // newstat.Name = parts[1]
+ newstat.TagHash = parts[0]
+ newstat.Name = parts[1]
- teststat := stats.FindByHash(newstat.Hash)
+ teststat := stats.FindByName(newstat.Name)
if teststat == nil {
counter += 1
stats.Append(newstat)
+ } else {
+ if teststat.Name == "" {
+ counter += 1
+ teststat.Name = parts[1]
+ }
}
}
if counter > 0 {
stats.SaveByHash()
- return errors.New(fmt.Sprintf("len(%d) refs changed: (%d)", stats.Len(), counter))
+ return errors.New(fmt.Sprintf("%s: len(%d) saved. changed %d refs.", stats.Filename, stats.Len(), counter))
}
return nil
}