fix: fetch base branch before performing merge-base

Also make sure the copright script honors the refspec that's passed on
it's command line.

Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
Change-Id: I91250c39015129c3c1eef0891ff55ee2ea6f74b1
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 66763bc..7e25f64 100755
--- a/script/static-checks/static-checks-coding-style-line-endings.sh
+++ b/script/static-checks/static-checks-coding-style-line-endings.sh
@@ -22,7 +22,7 @@
     shopt -s globstar
     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,rs} Makefile | \
+      --no-prefix **/{Makefile,*.{S,c,h,i,dts,dtsi,rst,mk,rs}} | \
       awk '/^\+/ && /\r$/' &> "$LOG_FILE"
 else
   # For all the source and doc files