rules: fix get_git_repo

The get_git_repo function should not delete the rules directory
in all case. This patch adds a flag to fix the function and update
code.