static-checks: Use proper ref branch when collecting commits to test

Use the actual branch specified in the CI run, instead of hardcoded
master/integration.

Addresses https://linaro.atlassian.net/browse/TFC-636

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Change-Id: Ic0fd0677978f226626d567108f17ccb864aa8095
diff --git a/script/static-checks/static-checks-coding-style-line-endings.sh b/script/static-checks/static-checks-coding-style-line-endings.sh
index 4a08cba..9c0cda7 100755
--- a/script/static-checks/static-checks-coding-style-line-endings.sh
+++ b/script/static-checks/static-checks-coding-style-line-endings.sh
@@ -5,6 +5,10 @@
 # SPDX-License-Identifier: BSD-3-Clause
 #
 
+this_dir="$(readlink -f "$(dirname "$0")")"
+. $this_dir/common.sh
+
+
 TEST_CASE="Line endings are valid"
 
 EXIT_VALUE=0
@@ -16,7 +20,7 @@
 if [[ "$2" == "patch" ]]; then
     cd "$1"
     shopt -s globstar
-    parent=$(git merge-base HEAD refs/remotes/origin/master | head -1)
+    parent=$(get_merge_base)
     git diff $parent..HEAD --no-ext-diff --unified=0 --exit-code -a \
       --no-prefix **/*.{S,c,h,i,dts,dtsi,rst,mk} Makefile | \
       awk '/^\+/ && /\r$/' &> "$LOG_FILE"