(ctx *uploadContext, updates []*git.RefUpdate, pushAll bool)
| 18 | ) |
| 19 | |
| 20 | func uploadForRefUpdates(ctx *uploadContext, updates []*git.RefUpdate, pushAll bool) error { |
| 21 | gitscanner := ctx.buildGitScanner() |
| 22 | defer ctx.ReportErrors() |
| 23 | |
| 24 | verifyLocksForUpdates(ctx.lockVerifier, updates) |
| 25 | exclude := make([]string, 0, len(updates)) |
| 26 | for _, update := range updates { |
| 27 | remoteRefSha := update.RemoteRef().Sha |
| 28 | if update.LocalRefCommitish() != remoteRefSha { |
| 29 | exclude = append(exclude, remoteRefSha) |
| 30 | } |
| 31 | } |
| 32 | for _, update := range updates { |
| 33 | // initialized here to prevent looped defer |
| 34 | q := ctx.NewQueue( |
| 35 | tq.RemoteRef(update.RemoteRef()), |
| 36 | ) |
| 37 | err := uploadRangeOrAll(gitscanner, ctx, q, exclude, update, pushAll) |
| 38 | ctx.CollectErrors(q) |
| 39 | |
| 40 | if err != nil { |
| 41 | return errors.Wrap(err, tr.Tr.Get("ref %q:", update.LocalRef().Name)) |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | return nil |
| 46 | } |
| 47 | |
| 48 | func uploadRangeOrAll(g *lfs.GitScanner, ctx *uploadContext, q *tq.TransferQueue, exclude []string, update *git.RefUpdate, pushAll bool) error { |
| 49 | cb := ctx.gitScannerCallback(q) |
no test coverage detected