Browse Source

#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)
af/merge-core
Unknown 8 years ago
parent
commit
6086b7a89b
  1. 4
      run-tests.ps1

4
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;

Loading…
Cancel
Save