Improved switch-branch.ps1

This commit is contained in:
Markus Fleschutz 2021-02-15 10:39:46 +01:00
parent 45abf86a17
commit 108f3ad743

View File

@ -20,6 +20,10 @@ try {
$Branch = read-host "Enter branch name to switch to"
}
& git switch --recurse-submodules $Branch
if ($lastExitCode -ne "0") {
throw "'git switch --recurse-submodules $Branch' failed"
}
& git status
exit 0
} catch {
write-error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"