fix a bug if repository is not clean.