added a check for non-clean repository to avoid loosing changes (closes #58)