mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-01-23 14:18:38 +01:00
Improve create-branch.ps1
This commit is contained in:
parent
b1c3295c48
commit
f02f1e726b
@ -19,6 +19,13 @@ try {
|
||||
& git --version
|
||||
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
||||
|
||||
$Result = (git status)
|
||||
if ($lastExitCode -ne "0") { throw "'git status' failed in $RepoDir" }
|
||||
if ("$Result" -notmatch "nothing to commit, working tree clean") { throw "Repository is NOT clean: $Result" }
|
||||
|
||||
& git fetch --all --recurse-submodules
|
||||
if ($lastExitCode -ne "0") { throw "'git fetch --all --recurse-submodules' failed" }
|
||||
|
||||
& git checkout -b "$NewBranchName"
|
||||
if ($lastExitCode -ne "0") { throw "'git checkout -b $NewBranchName' failed" }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user