From: Kienan Stewart Date: Tue, 29 Aug 2023 13:35:13 +0000 (-0400) Subject: ansible: Correct git mirror update script initial clone X-Git-Url: https://git.liburcu.org/?a=commitdiff_plain;h=c16adb7d1b18943602f5253bd57779ce76a1fc3c;p=lttng-ci.git ansible: Correct git mirror update script initial clone When '--mirror' isn't set, the remote references aren't always pulled. To fix an existing repository that is just a bare clone, the following commands can be run: ``` git remote rm origin git remote add --mirror=fetch origin URL git fetch --all ``` Change-Id: I9b713fe2dae523ba70a387adef23e87f98bb059a --- diff --git a/automation/ansible/roles/gitmirror/files/update.sh b/automation/ansible/roles/gitmirror/files/update.sh index d4379db..dabb4af 100644 --- a/automation/ansible/roles/gitmirror/files/update.sh +++ b/automation/ansible/roles/gitmirror/files/update.sh @@ -9,7 +9,7 @@ update_git() { local origin="$2" if [ ! -d "${repodir}" ] ; then - git clone --bare "${origin}" "${repodir}" + git clone --mirror "${origin}" "${repodir}" fi pushd "$repodir"