1
0
Fork 0

Fixed cross linked device failing move of .git dir

Dieser Commit ist enthalten in:
lksz 2020-10-02 14:23:54 -04:00
Ursprung e14f00d98d
Commit fe97c2880a
1 geänderte Dateien mit 9 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -55,7 +55,15 @@ Get-Command Reload-MyScripts -ErrorAction SilentlyContinue | ForEach-Object { .
$local:GitOutput = "$(& git clone $GitURL $tmpGitDir.FullName --no-checkout)"
Write-Verbose $GitOutput
Write-Verbose "Moving git repo from temp location to $MyPSScriptRoot . . ."
Move-Item (Join-Path $tmpGitDir.FullName .git) ./.git
try {
Move-Item (Join-Path $tmpGitDir.FullName .git) ./.git -ErrorAction Stop
} catch {
if( $_.Exception.Message -eq "Invalid cross-device link" ) {
Copy-Item -Recurse (Join-Path $tmpGitDir.FullName .git) ./.git
} else {
throw $_
}
}
Remove-Item $tmpGitDir.FullName
Write-Verbose "Checking out repo..."
$GitOutput = "$(& git checkout --force)"