Skip to content

Commit 1531e41

Browse files
committed
Even if there is no storage update, there will be packfile update proposal with cid same as old cid
1 parent 5f0116a commit 1531e41

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

cmd/git-remote-gitopia/gitopia.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ func (h *GitopiaHandler) Push(remote *core.Remote, refsToPush []core.RefToPush)
262262
User: h.wallet.Address(),
263263
})
264264
if err == nil {
265-
return nil, fmt.Errorf("fatal: there is already a pending packfile update proposal for this repository. Please wait for it to be processed before pushing again")
265+
return nil, fmt.Errorf("fatal: there is already a pending packfile update proposal for this repository. Please wait for it to be processed or expired before pushing again")
266266
}
267267
if !strings.Contains(err.Error(), "packfile update proposal not found") {
268268
return nil, fmt.Errorf("error checking for pending proposals: %v", err)
@@ -406,24 +406,19 @@ func (h *GitopiaHandler) Push(remote *core.Remote, refsToPush []core.RefToPush)
406406
RepositoryId: h.remoteRepository.Id,
407407
User: h.wallet.Address(),
408408
})
409-
if err != nil && strings.Contains(err.Error(), "packfile update proposal not found") {
410-
// There is no change in packfile so set packfile cid to old_cid itself
411-
packfileCid = packfileRes.Packfile.OldCid
412-
} else if err != nil {
409+
if err != nil {
413410
return nil, err
414411
}
415412
if packfileUpdateProposalRes != nil {
416413
// Packfile update proposal exists, approve it
417414
msg = append(msg, storagetypes.NewMsgApproveRepositoryPackfileUpdate(h.wallet.Address(), packfileUpdateProposalRes.PackfileUpdateProposal.Id))
418415
}
419-
// If error occurs (e.g., proposal not found), continue without failing
420-
// This handles cases like tag pushes where objects already exist
421416

422417
lfsObjectUpdateProposalRes, err := h.storageClient.LFSObjectUpdateProposalsByRepositoryId(context.Background(), &storagetypes.QueryLFSObjectUpdateProposalsByRepositoryIdRequest{
423418
RepositoryId: h.remoteRepository.Id,
424419
User: h.wallet.Address(),
425420
})
426-
if err != nil && !strings.Contains(err.Error(), "lfs object update proposal not found") {
421+
if err != nil {
427422
return nil, err
428423
}
429424
if lfsObjectUpdateProposalRes != nil {
@@ -432,7 +427,6 @@ func (h *GitopiaHandler) Push(remote *core.Remote, refsToPush []core.RefToPush)
432427
msg = append(msg, storagetypes.NewMsgApproveLFSObjectUpdate(h.wallet.Address(), lfsObjectUpdateProposal.Id))
433428
}
434429
}
435-
// If error occurs (e.g., no LFS proposals), continue without failing
436430
}
437431

438432
if len(setBranches) > 0 {

0 commit comments

Comments
 (0)