sigh 3
This commit is contained in:
parent
4916a5c922
commit
67ff3a8c7f
@ -73,20 +73,21 @@ function Remove-ContentFromGitHistory {
|
|||||||
Write-Verbose "Relative content path: $path_content_relative"
|
Write-Verbose "Relative content path: $path_content_relative"
|
||||||
|
|
||||||
Write-Verbose "Removing Content directory from Git history..."
|
Write-Verbose "Removing Content directory from Git history..."
|
||||||
|
|
||||||
# Construct and execute filter-branch command
|
# Construct and execute filter-branch command
|
||||||
$filter_command = "git rm -r --cached --ignore-unmatch `"$path_content_relative`""
|
$filter_command = "git rm -r --cached --ignore-unmatch `"$path_content_relative`""
|
||||||
$filter_branch_cmd = "git $cgit_filter_branch $fgit_force $fgit_index_filter '$filter_command' $fgit_prune_empty $fgit_tag_name_filter $fgit_filter_concat $fgit_filter_separate $fgit_all"
|
$filter_branch_cmd = "git $cgit_filter_branch $fgit_force $fgit_index_filter '$filter_command' $fgit_prune_empty $fgit_tag_name_filter $fgit_filter_concat $fgit_filter_separate $fgit_all"
|
||||||
Write-Verbose "Executing command: $filter_branch_cmd"
|
Write-Verbose "Executing command: $filter_branch_cmd"
|
||||||
$job = Start-Job -ScriptBlock { Invoke-Expression $args[0] } -ArgumentList $filter_branch_cmd
|
$output = Invoke-Expression $filter_branch_cmd 2>&1
|
||||||
Wait-Job $job -Timeout 3600 # Wait for 1 hour max
|
$output | ForEach-Object {
|
||||||
if ($job.State -eq 'Running') {
|
if ($_ -match "WARNING:") {
|
||||||
Stop-Job $job
|
Write-Warning $_
|
||||||
throw "Filter-branch operation timed out after 1 hour"
|
} elseif ($_ -match "fatal:") {
|
||||||
} else {
|
throw $_
|
||||||
Receive-Job $job
|
} else {
|
||||||
|
Write-Verbose $_
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Remove-Job $job
|
|
||||||
|
|
||||||
Write-Verbose "Cleaning up refs..."
|
Write-Verbose "Cleaning up refs..."
|
||||||
# Clean up refs using git directly
|
# Clean up refs using git directly
|
||||||
|
Loading…
Reference in New Issue
Block a user