scripts: skip autopatch when not git [1/1]

PD#TV-142755

Problem:
skip autopatch when not git

Solution:
skip autopatch when not git

Verify:
local

Change-Id: I242f8d1fa8ea0741496b4879e45dc4a989ad73ef
Signed-off-by: qinglin.li <qinglin.li@amlogic.com>
diff --git a/amlogic_utils.sh b/amlogic_utils.sh
index 034706f..41dcef7 100644
--- a/amlogic_utils.sh
+++ b/amlogic_utils.sh
@@ -1591,7 +1591,12 @@
 		[[ "${FULL_KERNEL_VERSION}" != "common13-5.15" && "${ARCH}" == "arm64" ]] && BAZEL=1
 	fi
 
-	auto_patch_to_common_dir
+	if [[ -d ${KERNEL_DIR}/.git ]]; then
+		auto_patch_to_common_dir
+	else
+		echo "WARNING: no git, auto patch skip!!!"
+		export SYS_SKIP_GIT=1
+	fi
 
 	if [[ ! -f ${BUILD_DIR}/build_abi.sh && ${BAZEL} == 0 ]]; then
 		echo "The directory of build does not exist";