<commit_before>Function Update-GitRepository {
    [CmdletBinding()]

    # The path to the Registry key containing the Git installation details
    $GitInstallRegPath = 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Git_is1'
    # The name of the Registry property that gives the installation location
    $GitInstallDirProp = 'InstallLocation'

    # Ensure that any errors we receive are considered fatal
    $ErrorActionPreference = 'Stop'

    Function Test-GitInstalled {
        Write-Verbose 'Testing Git is installed...'

        if (!(Test-Path $GitInstallRegPath -PathType Container)) {
            Write-Error 'Git does not appear to be installed on this system.'
        } else {
            $GitPath = (Get-ItemProperty -Path $GitInstallRegPath).$GitInstallDirProp
            if (!(Test-Path $GitPath -PathType Container)) {
                Write-Error 'The Git installation on this system appears to be damaged.'
            }
        }

        # Amend the PATH variable to include the full set of Git utilities
        $Env:Path="$Env:Path;$GitPath\bin"

        # Setup the HOME environment variable needed by SSH (this caused some serious pain)
        #
        # More pain: if running as a Scheduled Task the user profile of the running account
        # may not yet be loaded on Windows 8 or Server 2012 and newer. As a result, the
        # USERPROFILE environment variable will point to the Default user profile. We can
        # seemingly work around this by using GetFolderPath() from the Environment class.
        #
        # See: https://support.microsoft.com/en-us/kb/2968540
        $Env:HOME = [Environment]::GetFolderPath([System.Environment+SpecialFolder]::UserProfile)
    }

    Function Test-GitRepository {
        Write-Verbose 'Testing current directory is a Git repository...'

        git rev-parse --git-dir 2>&1 | Out-Null
        if ($LASTEXITCODE -ne 0) {
            Write-Error 'The current directory is not part of a Git repository.'
        }
    }

    Function Test-Windows64bit {
        Write-Verbose 'Testing if we are running on 64-bit Windows...'

        if ((Get-WmiObject 'Win32_OperatingSystem').OSArchitecture -ne '64-bit') {<commit_msg>Check for either x86 or x64 installs of Git in Update-GitRepository<commit_after>Function Update-GitRepository {
    [CmdletBinding()]

    # The path to the Registry keys containing potential Git installation details
    $GitInstallRegPaths = @('HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Git_is1', # Native bitness
                            'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Git_is1') # x86 on x64
    # The name of the Registry property that gives the installation location
    $GitInstallDirProp = 'InstallLocation'

    # Ensure that any errors we receive are considered fatal
    $ErrorActionPreference = 'Stop'

    Function Test-GitInstalled {
        Write-Verbose 'Testing Git is installed...'

        foreach ($GitInstallRegPath in $GitInstallRegPaths) {
            if (Test-Path $GitInstallRegPath -PathType Container) {
                $GitPath = (Get-ItemProperty -Path $GitInstallRegPath).$GitInstallDirProp
                break
            }
        }

        if (!$GitPath) {
            Write-Error 'Git does not appear to be installed on this system.'
        }

        if (!(Test-Path $GitPath -PathType Container)) {
            Write-Error 'The Git installation on this system appears to be damaged.'
        }

        # Amend the PATH variable to include the full set of Git utilities
        $Env:Path="$Env:Path;$GitPath\bin"

        # Setup the HOME environment variable needed by SSH (this caused some serious pain)
        #
        # More pain: if running as a Scheduled Task the user profile of the running account
        # may not yet be loaded on Windows 8 or Server 2012 and newer. As a result, the
        # USERPROFILE environment variable will point to the Default user profile. We can
        # seemingly work around this by using GetFolderPath() from the Environment class.
        #
        # See: https://support.microsoft.com/en-us/kb/2968540
        $Env:HOME = [Environment]::GetFolderPath([System.Environment+SpecialFolder]::UserProfile)
    }

    Function Test-GitRepository {
        Write-Verbose 'Testing current directory is a Git repository...'

        git rev-parse --git-dir 2>&1 | Out-Null
        if ($LASTEXITCODE -ne 0) {
            Write-Error 'The current directory is not part of a Git repository.'
        }
    }

    Function Test-Windows64bit {
        Write-Verbose 'Testing if we are running on 64-bit Windows...'

        if ((Get-WmiObject 'Win32_OperatingSystem').OSArchitecture -ne '64-bit') {
{'fraction_non_alphanumeric': 0.08145653546621764, 'fraction_numerical': 0.013681330246263945, 'mean_word_length': 2.594553706505295, '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': '4192677', 'n_tokens_mistral': 1324, 'n_tokens_neox': 1209, 'n_words': 452}