fixed issue when cloning repo with tags.

Tags are still not handled (not cloned), but this fix avoids exceptions been raised in that case, cloning normally.

it fixes #510