Remove trailing .git if passed in as option.