MCPcopy
hub / github.com/git-lfs/git-lfs / uploadForRefUpdates

Function uploadForRefUpdates

commands/uploader.go:20–46  ·  view source on GitHub ↗
(ctx *uploadContext, updates []*git.RefUpdate, pushAll bool)

Source from the content-addressed store, hash-verified

18)
19
20func 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
48func uploadRangeOrAll(g *lfs.GitScanner, ctx *uploadContext, q *tq.TransferQueue, exclude []string, update *git.RefUpdate, pushAll bool) error {
49 cb := ctx.gitScannerCallback(q)

Callers 2

prePushCommandFunction · 0.85

Calls 12

RemoteRefFunction · 0.92
WrapFunction · 0.92
verifyLocksForUpdatesFunction · 0.85
uploadRangeOrAllFunction · 0.85
buildGitScannerMethod · 0.80
ReportErrorsMethod · 0.80
LocalRefCommitishMethod · 0.80
NewQueueMethod · 0.80
CollectErrorsMethod · 0.80
LocalRefMethod · 0.80
GetMethod · 0.65
RemoteRefMethod · 0.45

Tested by

no test coverage detected