Skip to content

Commit c79db6c

Browse files
committed
Approve packfile update and lfs object updates in remote helper
1 parent e2c412e commit c79db6c

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

cmd/git-remote-gitopia/gitopia.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,29 @@ func (h *GitopiaHandler) Push(remote *core.Remote, refsToPush []core.RefToPush)
403403
remote.Logger.Println("Please sign the gitopia transaction on your ledger device.")
404404
}
405405

406+
// Approve packfile update
407+
packfileUpdateProposalRes, err := h.storageClient.PackfileUpdateProposal(context.Background(), &storagetypes.QueryPackfileUpdateProposalRequest{
408+
RepositoryId: h.remoteRepository.Id,
409+
User: h.wallet.Address(),
410+
})
411+
if err != nil {
412+
return nil, err
413+
}
414+
msg = append(msg, storagetypes.NewMsgApproveRepositoryPackfileUpdate(h.wallet.Address(), packfileUpdateProposalRes.PackfileUpdateProposal.Id))
415+
416+
lfsObjectUpdateProposalRes, err := h.storageClient.LFSObjectUpdateProposal(context.Background(), &storagetypes.QueryLFSObjectUpdateProposalRequest{
417+
RepositoryId: h.remoteRepository.Id,
418+
User: h.wallet.Address(),
419+
})
420+
if err != nil {
421+
return nil, err
422+
}
423+
424+
// Approve LFS object update
425+
for _, lfsObjectUpdateProposal := range lfsObjectUpdateProposalRes.LfsObjectProposal {
426+
msg = append(msg, storagetypes.NewMsgApproveLFSObjectUpdate(h.wallet.Address(), lfsObjectUpdateProposal.Id))
427+
}
428+
406429
if err := h.wallet.SignAndBroadcast(h.grpcConn, msg); err != nil {
407430
return nil, err
408431
}

0 commit comments

Comments
 (0)