This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch v1-10-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 0d8a238cd8df59d6ba96ae1172618f53bebb3abc
Author: Jarek Potiuk <[email protected]>
AuthorDate: Tue Apr 28 12:48:30 2020 +0200

    Fixed optimistions of non-py-code builds (#8601)
    
    Count of changed files returned exit code 1 not 0 when there
    was no files matching the pattern, so the whole optimisation
    did not work as intended.
    
    (cherry picked from commit 00bbf324acf543e18571f89a760430b5730d1c40)
---
 scripts/ci/ci_count_changed_files.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/ci/ci_count_changed_files.sh 
b/scripts/ci/ci_count_changed_files.sh
index 262fb96..0713dc1 100755
--- a/scripts/ci/ci_count_changed_files.sh
+++ b/scripts/ci/ci_count_changed_files.sh
@@ -31,7 +31,7 @@ git remote add target "https://github.com/${CI_TARGET_REPO}";
 
 git fetch target "${CI_TARGET_BRANCH}:${CI_TARGET_BRANCH}" --depth=1
 
-CHANGED_FILES=$(git diff-tree --no-commit-id --name-only -r "${1}" 
"${CI_TARGET_BRANCH}")
+CHANGED_FILES=$(git diff-tree --no-commit-id --name-only -r "${1}" 
"${CI_TARGET_BRANCH}" || true)
 
 echo
 echo "Changed files:"
@@ -48,7 +48,7 @@ echo
 echo
 echo "Count changed files matching the ${2} pattern"
 echo
-COUNT_CHANGED_FILES=$(echo "${CHANGED_FILES}" | grep -c "${2}")
+COUNT_CHANGED_FILES=$(echo "${CHANGED_FILES}" | grep -c "${2}" || true)
 echo "${COUNT_CHANGED_FILES}"
 echo
 

Reply via email to