<commit_before>#!/usr/bin/env bash

csource="${BASH_SOURCE[0]}"
while [ -h "$csource" ] ; do csource="$(readlink "$csource")"; done
root="$( cd -P "$( dirname "$csource" )/../" && pwd )"

. "${root}/.ci/common.sh"

export PATH="${PATH}:${root}/.ci"

pushd "${root}" > "${output}"

if [ "${repo_name}" = "vagrant-installers" ]; then
    remote_repository="hashicorp/vagrant-builders"
else
    remote_repository="hashicorp/vagrant-installers"
fi

echo "Adding mirror repository `${remote_repository}`..."
wrap_stream git remote add mirror "https://${HASHIBOT_USERNAME}:${HASHIBOT_TOKEN}@github.com/${remote_repository}" \
            "Failed to add mirror repository (${remote_repository}) for sync"
echo "Currently configured remotes:"
git remote -v
warn "$(git remote -v)"

echo "Updating configured remotes..."
wrap_stream git remote update \
            "Failed to update mirror repository (${remote_repository}) for sync"
echo "Currently loaded refs:"
git branch -a

echo "Pushing master to mirror..."
wrap_stream git push mirror master \
            "Failed to sync mirror repository (${remote_repository})"<commit_msg>Attempt updating origin directly on sync<commit_after>#!/usr/bin/env bash

csource="${BASH_SOURCE[0]}"
while [ -h "$csource" ] ; do csource="$(readlink "$csource")"; done
root="$( cd -P "$( dirname "$csource" )/../" && pwd )"

. "${root}/.ci/common.sh"

export PATH="${PATH}:${root}/.ci"

pushd "${root}" > "${output}"

if [ "${repo_name}" = "vagrant-installers" ]; then
    remote_repository="hashicorp/vagrant-builders"
else
    remote_repository="hashicorp/vagrant-installers"
fi

echo "Updating repository origin to mirror repository `${remote_repository}`..."
wrap git remote set-url origin "https://${HASHIBOT_USERNAME}:${HASHIBOT_TOKEN}@github.com/${remote_repository}" \
     "Failed to update repository origin to `${remote_repository}` for sync"

echo "Currently configured remotes:"
git remote -v
warn "$(git remote -v)"

echo "Updating configured remotes..."
wrap_stream git remote update \
            "Failed to update mirror repository (${remote_repository}) for sync"
echo "Currently loaded refs:"
git branch -a

echo "Pushing master to mirror..."
wrap_stream git push origin master \
            "Failed to sync mirror repository (${remote_repository})"
{'fraction_non_alphanumeric': 0.16179677278674226, 'fraction_numerical': 0.0008722197993894462, 'mean_word_length': 4.527710843373494, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2910192', 'n_tokens_mistral': 711, 'n_tokens_neox': 698, 'n_words': 206}