only clear the repo when necessary. closes #20