check whether staged changes exist before committing