Specify the comparison branch other than GERRIT_BRANCH

Change-Id: I45538bd4b5d6118dc5c1d6995afad48fcb4556d9
diff --git a/chart_version_check.sh b/chart_version_check.sh
index e070375..d00cd9e 100755
--- a/chart_version_check.sh
+++ b/chart_version_check.sh
@@ -29,10 +29,11 @@
 WORKSPACE=${WORKSPACE:-.}
 
 # branch to compare against, defaults to master
-GERRIT_BRANCH=${GERRIT_BRANCH:-opencord/master}
+COMPARISON_BRANCH="${COMPARISON_BRANCH:-opencord/master}"
+echo "# Comparing with branch: $COMPARISON_BRANCH"
 
 # Create list of changed files compared to branch
-changed_files=$(git diff --name-only "${GERRIT_BRANCH}")
+changed_files=$(git diff --name-only "${COMPARISON_BRANCH}")
 
 # Create list of untracked by git files
 untracked_files=$(git ls-files -o --exclude-standard)
@@ -45,7 +46,7 @@
 else
   if [ -n "$changed_files" ]
   then
-    echo "Changed files compared with $GERRIT_BRANCH:"
+    echo "Changed files compared with $COMPARISON_BRANCH:"
     # Search and replace per SC2001 doesn't recognize ^ (beginning of line)
     # shellcheck disable=SC2001
     echo "${changed_files}" | sed 's/^/  /'
@@ -88,7 +89,7 @@
   done
 
   # See if chart version changed using 'git diff', and is SemVer
-  chart_yaml_diff=$(git diff -p "$GERRIT_BRANCH" "${chartdir}/Chart.yaml")
+  chart_yaml_diff=$(git diff -p "$COMPARISON_BRANCH" -- "${chartdir}/Chart.yaml")
 
   if [ -n "$chart_yaml_diff" ]
   then