3901: Add missing error checks while copying git objects.
Merge branch '3901-cannot-find-commit' refs #3901