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

Function uploadsWithObjectIDs

commands/command_push.go:104–130  ·  view source on GitHub ↗
(ctx *uploadContext, oids []string)

Source from the content-addressed store, hash-verified

102}
103
104func uploadsWithObjectIDs(ctx *uploadContext, oids []string) {
105 pointers := make([]*lfs.WrappedPointer, len(oids))
106 for i, oid := range oids {
107 mp, err := ctx.gitfilter.ObjectPath(oid)
108 if err != nil {
109 ExitWithError(errors.Wrap(err, tr.Tr.Get("Unable to find local media path:")))
110 }
111
112 stat, err := os.Stat(mp)
113 if err != nil {
114 ExitWithError(errors.Wrap(err, tr.Tr.Get("Unable to stat local media path")))
115 }
116
117 pointers[i] = &lfs.WrappedPointer{
118 Name: mp,
119 Pointer: &lfs.Pointer{
120 Oid: oid,
121 Size: stat.Size(),
122 },
123 }
124 }
125
126 q := ctx.NewQueue(tq.RemoteRef(currentRemoteRef()))
127 ctx.UploadPointers(q, pointers...)
128 ctx.CollectErrors(q)
129 ctx.ReportErrors()
130}
131
132// lfsPushRefs returns valid ref updates from the given ref and --all arguments.
133// Either one or more refs can be explicitly specified, or --all indicates all

Callers 1

pushCommandFunction · 0.85

Calls 11

WrapFunction · 0.92
RemoteRefFunction · 0.92
ExitWithErrorFunction · 0.85
currentRemoteRefFunction · 0.85
SizeMethod · 0.80
NewQueueMethod · 0.80
UploadPointersMethod · 0.80
CollectErrorsMethod · 0.80
ReportErrorsMethod · 0.80
GetMethod · 0.65
ObjectPathMethod · 0.45

Tested by

no test coverage detected