diff --git a/ngraph/python/tests/test_onnx/model_zoo_preprocess.sh b/ngraph/python/tests/test_onnx/model_zoo_preprocess.sh index 0c582ea63dd1a2..703e5af64bc655 100755 --- a/ngraph/python/tests/test_onnx/model_zoo_preprocess.sh +++ b/ngraph/python/tests/test_onnx/model_zoo_preprocess.sh @@ -71,6 +71,8 @@ function pull_and_postprocess_onnx_model_zoo() { mkdir -p test_data_set_0 mv *.pb test_data_set_0/ + # Save SHA of successfully post processed repository + git rev-parse HEAD > onnx_sha } function update_onnx_models() { @@ -81,7 +83,7 @@ function update_onnx_models() { pull_and_postprocess_onnx_model_zoo else # Check if ONNX Model Zoo directory consists of proper git repo - git_remote_url=`git -C $ONNX_MODELS_DIR config --local remote.origin.url 2> /dev/null 2>&1` + export git_remote_url=`git -C $ONNX_MODELS_DIR config --local remote.origin.url 2> /dev/null 2>&1` printf "ONNX Model Zoo repository exists: %s\n" "$ONNX_MODELS_DIR" if [[ $git_remote_url = "https://github.com/onnx/models.git" ]]; then printf "The proper github repository detected: %s\n" "$git_remote_url" @@ -92,7 +94,7 @@ function update_onnx_models() { fi cd "$ONNX_MODELS_DIR" - CURRENT_ONNX_MODELS_SHA=`git rev-parse HEAD` + export CURRENT_ONNX_MODELS_SHA=`head -n1 onnx_sha 2> /dev/null 2>&1` if [[ $ONNX_SHA = $CURRENT_ONNX_MODELS_SHA ]] ; then echo "ONNX Model Zoo repository is in the right state" else