diff --git a/Scripts/switch-branch.ps1 b/Scripts/switch-branch.ps1 index f994e814..f0c6f7da 100755 --- a/Scripts/switch-branch.ps1 +++ b/Scripts/switch-branch.ps1 @@ -12,7 +12,7 @@ .LINK https://github.com/fleschutz/PowerShell .NOTES - Author: Markus Fleschutz / License: CC0 + Author: Markus Fleschutz | License: CC0 #> param([string]$BranchName = "", [string]$RepoDir = "$PWD") @@ -35,7 +35,7 @@ try { if ($lastExitCode -ne "0") { throw "'git status' in $RepoDir failed with exit code $lastExitCode" } if ("$Result" -notmatch "nothing to commit, working tree clean") { throw "Git repository is NOT clean: $Result" } - "⏳ Step 2/5: Fetching latest updates..." + "⏳ Step 2/5: Fetching updates..." & git fetch --all --recurse-submodules --prune --prune-tags --force if ($lastExitCode -ne "0") { throw "'git fetch --all' failed with exit code $lastExitCode" } @@ -53,7 +53,7 @@ try { $RepoDirName = (get-item "$RepoDir").Name [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "✔️ switched Git repo 📂$RepoDirName to $BranchName branch in $Elapsed sec" + "✔️ switched repo 📂$RepoDirName to '$BranchName' branch in $Elapsed sec" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"