Rewrote proxy detection logic to deal with all combinations of no/authenticated/unauthenticated proxy servers

This commit is contained in:
Martin Lablans
2023-10-20 15:59:24 +02:00
parent 68cd62b981
commit 74817a21da
2 changed files with 28 additions and 14 deletions

View File

@@ -50,8 +50,7 @@ for DIR in /etc/bridgehead $(pwd); do
git -C $DIR config credential.helper "$CREDHELPER"
fi
old_git_hash="$(git -C $DIR rev-parse --verify HEAD)"
if [ -z "$HTTP_PROXY_URL" ]; then
log "INFO" "Git is using no proxy!"
if [ -z "$HTTP_PROXY_FULL_URL" ]; then
OUT=$(retry 5 git -C $DIR fetch 2>&1 && retry 5 git -C $DIR pull 2>&1)
else
log "INFO" "Git is using proxy ${HTTP_PROXY_URL} from ${CONFFILE}"