diff --git a/RdzeN-Profile.ps1 b/RdzeN-Profile.ps1 index f61a82c..e0faf80 100644 --- a/RdzeN-Profile.ps1 +++ b/RdzeN-Profile.ps1 @@ -51,9 +51,14 @@ if (-not (Test-Path $path_profile_file)) { } else { # Check if the profile file has been modified $local_profile_hash = Get-FileHash -Path $path_profile_file -Algorithm SHA1 - $remote_profile_hash = git hash-object $path_profile_file - if ($local_profile_hash.Hash -ne $remote_profile_hash.Trim()) { + # Dodaj nagłówek do lokalnego hasha + $local_profile_hash_with_header = "blob $($local_profile_hash.Length)`0" + (Get-Content $path_profile_file -Raw) + $local_profile_hash_with_header = Get-FileHash -Algorithm SHA1 -InputStream ([System.IO.MemoryStream]::new([System.Text.Encoding]::UTF8.GetBytes($local_profile_hash_with_header))) + + $remote_profile_hash = & git hash-object $path_profile_file + + if ($local_profile_hash_with_header.Hash.ToLower() -ne $remote_profile_hash.Trim()) { Write-Host "Local profile file has been modified. Pulling from repository..." -ForegroundColor Yellow Pull-Repository Get-ChildItem $path_gitea_powershell_profile_functions | ForEach-Object {