Most recent Git client returns protocol in get-url origin (#2684)

This leads to constant redownloading of sources in case your access ssh, while url is not written that way.
This commit is contained in:
Igor Pečovnik
2021-03-03 20:31:53 +01:00
committed by GitHub
parent 98c1cbc889
commit 3b1c94a268

View File

@@ -272,7 +272,7 @@ fetch_from_repo()
# Then the target URL matches the local URL.
if [[ "$(improved_git rev-parse --git-dir 2>/dev/null)" == ".git" && \
"$url" != "$(improved_git remote get-url origin 2>/dev/null)" ]]; then
"$url" != *"$(improved_git remote get-url origin | sed 's/^.*@//' | sed 's/^.*\/\///' 2>/dev/null)" ]]; then
display_alert "Remote URL does not match, removing existing local copy"
rm -rf .git ./*
fi