commands/uploader.go: update object skip comments
In commit 338ab406ba35a0645bc660f8cb24dad8913f9490 of PR #1812 the prepareUpload() function was refactored so that it no longer checked whether an object to be pushed had a local file copy or not and skipped it if it did not. (That functionality already existed in the uploadTransfer() function in that it called the ensureFile() function before returning a tq.Transfer object. Note that these functions were in the commands/commands.go source file at the time. The uploadTransfer() function is called for each pointer blob object by uploadPointers().) However, commit 338ab406ba35a0645bc660f8cb24dad8913f9490 did not update the comment in prepareUpload() which stated that the function skipped any objects which did not have local file copies, so we now revise that comment and add one in the uploadTransfer() function.
This commit is contained in:
parent
655824071b
commit
9abba2664e
@ -190,8 +190,8 @@ func (c *uploadContext) prepareUpload(unfiltered ...*lfs.WrappedPointer) []*lfs.
|
||||
// scanner
|
||||
uniqOids := tools.NewStringSet()
|
||||
|
||||
// separate out objects that _should_ be uploaded, but don't exist in
|
||||
// .git/lfs/objects. Those will skipped if the server already has them.
|
||||
// Skip any objects which we've seen or already uploaded, as well
|
||||
// as any which are locked by other users.
|
||||
for _, p := range unfiltered {
|
||||
// object already uploaded in this process, or we've already
|
||||
// seen this OID (see above), skip!
|
||||
@ -358,6 +358,8 @@ func (c *uploadContext) uploadTransfer(p *lfs.WrappedPointer) (*tq.Transfer, err
|
||||
return nil, errors.Wrap(err, tr.Tr.Get("Error uploading file %s (%s)", filename, oid))
|
||||
}
|
||||
|
||||
// Skip the object if its corresponding file does not exist in
|
||||
// .git/lfs/objects/.
|
||||
if len(filename) > 0 {
|
||||
if missing, err = c.ensureFile(filename, localMediaPath, oid); err != nil && !errors.IsCleanPointerError(err) {
|
||||
return nil, err
|
||||
|
Loading…
Reference in New Issue
Block a user