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

potiuk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/master by this push:
     new 4112723  Fix CI: Don't add & fetch remote if source branch == target 
branch (#9961)
4112723 is described below

commit 4112723f80452c2bde7668f7166a9fb501b3319a
Author: Kaxil Naik <[email protected]>
AuthorDate: Fri Jul 24 00:22:25 2020 +0100

    Fix CI: Don't add & fetch remote if source branch == target branch (#9961)
---
 scripts/ci/openapi/client_codegen_diff.sh | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/scripts/ci/openapi/client_codegen_diff.sh 
b/scripts/ci/openapi/client_codegen_diff.sh
index c2edbda..5c37a1b 100755
--- a/scripts/ci/openapi/client_codegen_diff.sh
+++ b/scripts/ci/openapi/client_codegen_diff.sh
@@ -23,9 +23,10 @@ SCRIPTS_CI_DIR=$(dirname "${BASH_SOURCE[0]}")
 get_environment_for_builds_on_ci
 
 set -e
-
-git remote add target "https://github.com/${CI_TARGET_REPO}";
-git fetch target "${CI_TARGET_BRANCH}:${CI_TARGET_BRANCH}" --depth=1
+if [ "${CI_TARGET_REPO}" != "${CI_SOURCE_BRANCH}" ]; then
+    git remote add target "https://github.com/${CI_TARGET_REPO}";
+    git fetch target "${CI_TARGET_BRANCH}:${CI_TARGET_BRANCH}" --depth=1
+fi
 
 echo "Diffing openapi spec against ${CI_TARGET_BRANCH}..."
 

Reply via email to