checkpatch_presubmit: match on exact ${KERNEL_DIR} on applied.prop

Modify the regex to only parse changes made on the ${KERNEL_DIR}. Some
kernel manifests have projects which paths start with ${KERNEL_DIR} and
the script currently matches those change: this ends up running
checkpatch on the main ${KERNEL_DIR} instead of the actual project and
fail.

BUG: 138624505

Change-Id: I6e97b31646115f59f8bc5b233454bebf8480f5af
Signed-off-by: Alain Vongsouvanh <alainv@google.com>
diff --git a/static_analysis/checkpatch_presubmit.sh b/static_analysis/checkpatch_presubmit.sh
index 2e62001..425de82 100755
--- a/static_analysis/checkpatch_presubmit.sh
+++ b/static_analysis/checkpatch_presubmit.sh
@@ -78,7 +78,7 @@
 
 # Pick the correct patch to test.
 verify_file_exists ${APPLIED_PROP_PATH}
-GIT_SHA1=$(grep -Po "${KERNEL_DIR}.*\K[0-9a-f]{40}" "${APPLIED_PROP_PATH}") || true
+GIT_SHA1=$(grep -Po "${KERNEL_DIR} .*\K[0-9a-f]{40}" "${APPLIED_PROP_PATH}") || true
 if [[ -z ${GIT_SHA1} ]]; then
   # Since applied.prop only tracks user changes, ignore projects that are
   # included in presubmit without any changed files.
@@ -98,4 +98,3 @@
 fi
 
 ${STATIC_ANALYSIS_SRC_DIR}/checkpatch.sh --git_sha1 ${GIT_SHA1} ${FORWARDED_ARGS[*]}
-