From c16adb7d1b18943602f5253bd57779ce76a1fc3c Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Tue, 29 Aug 2023 09:35:13 -0400 Subject: [PATCH 1/1] 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 --- automation/ansible/roles/gitmirror/files/update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" -- 2.34.1