Fix fail clone local repository because can't found object

avoid use object which is already free

Signed-off-by: Frank Li <lznuaa@gmail.com>
Merge pull request #1283 from lznuaa/master

Fix local repository clone failure