summaryrefslogtreecommitdiff
path: root/stat.makeRemoteRefs.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-11-05 11:18:00 -0600
committerJeff Carr <[email protected]>2025-11-05 11:18:00 -0600
commitb7efa450a8a220625174f21ae15f9b7ea1cd3a3b (patch)
treed68c79ff27a898c80f31d78bdd8c76497aaef17a /stat.makeRemoteRefs.go
parent97ee30185a19669b0faa7150da978dcbaec4512a (diff)
almost working stat.protov0.0.181v0.0.180
Diffstat (limited to 'stat.makeRemoteRefs.go')
-rw-r--r--stat.makeRemoteRefs.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/stat.makeRemoteRefs.go b/stat.makeRemoteRefs.go
index b1a5736..571843f 100644
--- a/stat.makeRemoteRefs.go
+++ b/stat.makeRemoteRefs.go
@@ -28,7 +28,8 @@ func (r *Repo) MakeRemoteRefs(remoteName string) (*Stats, error) {
return stats, err
}
if stats.Len() != 0 {
- return stats, errors.New("refs file was already created")
+ // file was already created and populated with data
+ return stats, nil
}
cmd := []string{"git", "ls-remote", remoteName} // must use 'master' as queried from the git server // GO has 250k remote refs
if env.True("stats") {
@@ -53,7 +54,7 @@ func (r *Repo) MakeRemoteRefs(remoteName string) (*Stats, error) {
}
counter += 1
newstat := new(Stat)
- newstat.Hash = parts[0]
+ newstat.TagHash = parts[0]
stats.Append(newstat)
}
if counter > 0 {
@@ -116,7 +117,7 @@ func (r *Repo) UpdateRemoteRefs(remoteName string) error {
// }
counter += 1
newstat := new(Stat)
- newstat.Hash = parts[0]
+ newstat.TagHash = parts[0]
n, found := slices.BinarySearchFunc(stats.Stats, newstat, func(a, b *Stat) int {
return strings.Compare(a.Hash, b.Hash)
})