Skip to content

Commit e2c412e

Browse files
committed
Query the packfile state before push
1 parent a671c28 commit e2c412e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

cmd/git-remote-gitopia/gitopia.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,14 @@ func (h *GitopiaHandler) Push(remote *core.Remote, refsToPush []core.RefToPush)
269269
var deleteBranches, deleteTags []string
270270
var res []string
271271

272+
var packfileCid string
273+
packfileRes, err := h.storageClient.RepositoryPackfile(context.Background(), &storagetypes.QueryRepositoryPackfileRequest{
274+
RepositoryId: h.remoteRepository.Id,
275+
})
276+
if err == nil {
277+
packfileCid = packfileRes.Packfile.Cid
278+
}
279+
272280
for _, ref := range refsToPush {
273281
if ref.Local == "" {
274282
if strings.HasPrefix(ref.Remote, branchPrefix) {
@@ -365,14 +373,6 @@ func (h *GitopiaHandler) Push(remote *core.Remote, refsToPush []core.RefToPush)
365373
}
366374
}
367375

368-
var packfileCid string
369-
packfileRes, err := h.storageClient.RepositoryPackfile(context.Background(), &storagetypes.QueryRepositoryPackfileRequest{
370-
RepositoryId: h.remoteRepository.Id,
371-
})
372-
if err == nil {
373-
packfileCid = packfileRes.Packfile.Cid
374-
}
375-
376376
var msg []sdk.Msg
377377
if len(setBranches) > 0 {
378378
msg = append(msg, gitopiatypes.NewMsgMultiSetBranch(h.wallet.Address(), gitopiatypes.RepositoryId{

0 commit comments

Comments
 (0)