Improved behavior of the script with git repositories.