summaryrefslogtreecommitdiff
path: root/stat.makeRemote.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-11-03 18:40:33 -0600
committerJeff Carr <[email protected]>2025-11-03 18:40:33 -0600
commita6400fb71a0474be9291c562d73fcb9746f02add (patch)
treea0ca7bf6bc3866146b81a8b62aa0d5501bd3d1de /stat.makeRemote.go
parentc085c43172656665d0bba9c5bcc1b8d57b50bba8 (diff)
here were are somewhere. notsure where. but somewhere
Diffstat (limited to 'stat.makeRemote.go')
-rw-r--r--stat.makeRemote.go19
1 files changed, 16 insertions, 3 deletions
diff --git a/stat.makeRemote.go b/stat.makeRemote.go
index a5d746a..0dbd7a3 100644
--- a/stat.makeRemote.go
+++ b/stat.makeRemote.go
@@ -5,9 +5,11 @@ import (
"path/filepath"
"strings"
+ "go.wit.com/lib/cobol"
"go.wit.com/lib/config"
"go.wit.com/lib/env"
"go.wit.com/log"
+ timestamppb "google.golang.org/protobuf/types/known/timestamppb"
)
// loads what is on disk already. that is all
@@ -52,9 +54,9 @@ func (r *Repo) MakeRemote(remoteName string) (*Stats, error) {
var counter int
for _, line := range cmdout.Stdout {
line = strings.TrimSpace(line)
- parts := strings.Fields(line)
- if len(parts) != 2 {
- log.Printf("Repo: %s\n", r.FullPath)
+ parts := strings.Split(line, standardSeperator)
+ if len(parts) != 5 {
+ log.Printf("Repo: %s len(%d)\n", r.FullPath, len(parts))
log.Printf("CMD: %v\n", cmd)
log.Printf("LINE:%s\n", line)
return stats, errors.New(line)
@@ -65,6 +67,17 @@ func (r *Repo) MakeRemote(remoteName string) (*Stats, error) {
counter += 1
newstat := new(Stat)
newstat.Hash = parts[0]
+ newstat.TreeHash = parts[1]
+ t, err := cobol.GetTime(parts[2])
+ _ = err
+ if t != nil {
+ newstat.AuthorTime = timestamppb.New(*t)
+ }
+ t, err = cobol.GetTime(parts[3])
+ if t != nil {
+ newstat.CommitTime = timestamppb.New(*t)
+ }
+ newstat.SanitizedSubject = parts[4]
stats.Append(newstat)
}
if counter > 0 {