From cd2bd97708a63b21e8579e5ff85f907e4cf28c4e Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Tue, 8 Jun 2021 13:30:00 +0200 Subject: [PATCH] Improve pull-repo.ps1 --- Scripts/pull-repo.ps1 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Scripts/pull-repo.ps1 b/Scripts/pull-repo.ps1 index 2a2e2c9b..a652ca50 100755 --- a/Scripts/pull-repo.ps1 +++ b/Scripts/pull-repo.ps1 @@ -17,8 +17,14 @@ try { if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" } "🢃 Pulling updates..." - & git pull --recurse-submodules --jobs=4 - if ($lastExitCode -ne "0") { throw "'git pull' failed" } + $Result = (git pull --recurse-submodules --jobs=4) + if ($lastExitCode -ne "0") { + if ("$Result" -match "You are not currently on a branch.") { + "NOTE: not on a branch, nothing to pull" + } else { + throw "'git pull' failed" } + } + } $RepoDirName = (get-item "$RepoDir").Name [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds