@@ -3,14 +3,15 @@ package id
33import (
44 "context"
55
6+ "github.com/gov4git/lib4git/form"
67 "github.com/gov4git/lib4git/git"
78 "github.com/gov4git/lib4git/must"
89)
910
1011func Init (
1112 ctx context.Context ,
1213 ownerAddr OwnerAddress ,
13- ) git.Change [PrivateCredentials ] {
14+ ) git.Change [form. None , PrivateCredentials ] {
1415 ownerCloned := CloneOwner (ctx , ownerAddr )
1516 privChg := InitLocal (ctx , ownerAddr , ownerCloned )
1617
@@ -23,7 +24,7 @@ func InitLocal(
2324 ctx context.Context ,
2425 ownerAddr OwnerAddress ,
2526 ownerCloned OwnerCloned ,
26- ) git.Change [PrivateCredentials ] {
27+ ) git.Change [form. None , PrivateCredentials ] {
2728
2829 privChg := initPrivateStageOnly (ctx , ownerCloned .Private .Tree (), ownerAddr )
2930 pubChg := initPublicStageOnly (ctx , ownerCloned .Public .Tree (), privChg .Result .PublicCredentials )
@@ -32,25 +33,26 @@ func InitLocal(
3233 return privChg
3334}
3435
35- func initPrivateStageOnly (ctx context.Context , priv * git.Tree , ownerAddr OwnerAddress ) git.Change [PrivateCredentials ] {
36+ func initPrivateStageOnly (ctx context.Context , priv * git.Tree , ownerAddr OwnerAddress ) git.Change [form. None , PrivateCredentials ] {
3637 if _ , err := priv .Filesystem .Stat (PrivateCredentialsNS .Path ()); err == nil {
3738 must .Errorf (ctx , "private credentials file already exists" )
3839 }
3940 cred , err := GenerateCredentials ()
4041 must .NoError (ctx , err )
4142 git .ToFileStage (ctx , priv , PrivateCredentialsNS .Path (), cred )
42- return git.Change [PrivateCredentials ]{
43- Result : cred ,
44- Msg : "Initialized private credentials." ,
45- }
43+ return git .NewChange (
44+ "Initialized private credentials." ,
45+ "id_init_private" ,
46+ form.None {},
47+ cred ,
48+ nil ,
49+ )
4650}
4751
4852func initPublicStageOnly (ctx context.Context , pub * git.Tree , cred PublicCredentials ) git.ChangeNoResult {
4953 if _ , err := pub .Filesystem .Stat (PublicCredentialsNS .Path ()); err == nil {
5054 must .Errorf (ctx , "public credentials file already exists" )
5155 }
5256 git .ToFileStage (ctx , pub , PublicCredentialsNS .Path (), cred )
53- return git.ChangeNoResult {
54- Msg : "Initialized public credentials." ,
55- }
57+ return git .NewChangeNoResult ("Initialized public credentials." , "id_init_public" )
5658}
0 commit comments