Skip to content

Commit 905dcfc

Browse files
authored
Merge pull request #392 from jfontan/skip-alreadyuptodate
borges: skip error for already updated repos
2 parents 0de7164 + 6820e59 commit 905dcfc

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

archiver.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,9 @@ func (a *Archiver) pushChangesToRootedRepository(
477477

478478
refspecs := a.changesToPushRefSpec(r.ID, changes)
479479
pushStart := time.Now()
480-
if err := tr.Push(ctx, url, refspecs); err != nil {
480+
481+
err := tr.Push(ctx, url, refspecs)
482+
if err != nil && err != git.NoErrAlreadyUpToDate {
481483
onlyPushDurationSec := int64(time.Since(pushStart) / time.Second)
482484
logger.With(log.Fields{
483485
"refs": refspecs,

archiver_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"gopkg.in/src-d/core-retrieval.v0/model"
2121
"gopkg.in/src-d/core-retrieval.v0/repository"
2222
"gopkg.in/src-d/core-retrieval.v0/test"
23-
"gopkg.in/src-d/go-billy-siva.v4"
23+
sivafs "gopkg.in/src-d/go-billy-siva.v4"
2424
billy "gopkg.in/src-d/go-billy.v4"
2525
"gopkg.in/src-d/go-billy.v4/osfs"
2626
fixtures "gopkg.in/src-d/go-git-fixtures.v3"
@@ -556,6 +556,7 @@ func deleteReferences(fs billy.Filesystem, id, root string) error {
556556
if err != nil {
557557
return err
558558
}
559+
defer siva.Sync()
559560

560561
storage := filesystem.NewStorage(siva, nil)
561562
repo, err := git.Open(storage, nil)

0 commit comments

Comments
 (0)