Omit trailing .git from url when comparing git remote urls.

This commit is contained in:
Patrick Northon 2023-10-25 02:31:33 -04:00 committed by Allan McRae
parent 94d9c2affe
commit 0108e2c64e

View file

@ -56,7 +56,8 @@ download_git() {
elif (( ! HOLDVER )); then elif (( ! HOLDVER )); then
cd_safe "$dir" cd_safe "$dir"
# Make sure we are fetching the right repo # Make sure we are fetching the right repo
if [[ "$url" != "$(git config --get remote.origin.url)" ]] ; then local remote_url="$(git config --get remote.origin.url)"
if [[ "${url%%.git}" != "${remote_url%%.git}" ]] ; then
error "$(gettext "%s is not a clone of %s")" "$dir" "$url" error "$(gettext "%s is not a clone of %s")" "$dir" "$url"
plainerr "$(gettext "Aborting...")" plainerr "$(gettext "Aborting...")"
exit 1 exit 1