From 6086b7a89b78920904995c4fed4931f0c9f18d33 Mon Sep 17 00:00:00 2001 From: Unknown Date: Fri, 4 May 2018 20:46:08 +0200 Subject: [PATCH] #557: fix string comparison and wrong logic 1) -contains is for arrays, not for strings, so we use match (and mask the -) 2) if a module is not initialized the status contains the string ((null)) where usually the commit id is placed (the Hash in parantheses) --- run-tests.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/run-tests.ps1 b/run-tests.ps1 index fa3f96ed52..457f4ef408 100644 --- a/run-tests.ps1 +++ b/run-tests.ps1 @@ -20,11 +20,11 @@ function CheckSubmoduleStatus() { # if the result string is empty, the command failed to run (we didn't capture the error stream) if ($submoduleStatus) { # git has been called successfully, what about the status? - if ($submoduleStatus -contains '-') + if (($submoduleStatus -match "\-") -or ($submoduleStatus -match "\(\(null\)\)")) { # submodule has not been initialized! return 2; - } elseif ($submoduleStatus -contains '+') + } elseif ($submoduleStatus -match "\+") { # submodule is not synced: return 1;