diff options
Diffstat (limited to 'patchset.Make.go')
| -rw-r--r-- | patchset.Make.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/patchset.Make.go b/patchset.Make.go index 5081cb9..08b8ccc 100644 --- a/patchset.Make.go +++ b/patchset.Make.go @@ -6,9 +6,12 @@ import ( "os" "path/filepath" "strings" + "time" + "github.com/google/uuid" "go.wit.com/lib/protobuf/gitpb" "go.wit.com/log" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" ) // creates a patchset @@ -16,6 +19,8 @@ import ( func (f *Forge) MakeDevelPatchSet(name string) (*Patchset, error) { pset := new(Patchset) pset.Name = name + pset.Ctime = timestamppb.New(time.Now()) + pset.Uuid = uuid.New().String() if os.Getenv("GIT_AUTHOR_NAME") == "" { return nil, fmt.Errorf("GIT_AUTHOR_NAME not set") } else { @@ -142,7 +147,9 @@ func (pset *Patchset) makePatchSetNew(repo *gitpb.Repo) error { return nil } - return pset.addPatchFiles(repo) + err = pset.addPatchFiles(repo) + pset.Ctime = timestamppb.New(time.Now()) + return err } // process each file in pDir/ @@ -184,6 +191,7 @@ func (p *Patchset) addPatchFiles(repo *gitpb.Repo) error { p.Patches = new(Patches) } p.Patches.Append(patch) + p.Patches.Uuid = uuid.New().String() // log.Info("ADDED PATCH FILE", path) return nil }) |
