Merge pull request #3398 from bk2204/missing-object-message

Improve error message on missing object
This commit is contained in:
brian m. carlson 2018-11-28 18:52:04 +00:00 committed by GitHub
commit f09cac72bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -347,7 +347,7 @@ func (c *uploadContext) uploadTransfer(p *lfs.WrappedPointer) (*tq.Transfer, err
}
if len(filename) > 0 {
if err = c.ensureFile(filename, localMediaPath); err != nil && !errors.IsCleanPointerError(err) {
if err = c.ensureFile(filename, localMediaPath, oid); err != nil && !errors.IsCleanPointerError(err) {
return nil, err
}
}
@ -362,7 +362,7 @@ func (c *uploadContext) uploadTransfer(p *lfs.WrappedPointer) (*tq.Transfer, err
// ensureFile makes sure that the cleanPath exists before pushing it. If it
// does not exist, it attempts to clean it by reading the file at smudgePath.
func (c *uploadContext) ensureFile(smudgePath, cleanPath string) error {
func (c *uploadContext) ensureFile(smudgePath, cleanPath, oid string) error {
if _, err := os.Stat(cleanPath); err == nil {
return nil
}
@ -373,7 +373,7 @@ func (c *uploadContext) ensureFile(smudgePath, cleanPath string) error {
if c.allowMissing {
return nil
}
return err
return errors.Wrapf(err, "Unable to find source for object %v (try running git lfs fetch --all)", oid)
}
defer file.Close()