From 82495bfc550a0a40935805fd2b4a7eff2fd1a625 Mon Sep 17 00:00:00 2001 From: Will McVicker Date: Tue, 4 May 2021 11:24:46 -0700 Subject: [PATCH] build_slider.sh: Detect if git knows about aosp/android12-5.10 If the user hasn't fetched aosp/android12-5.10, then checking the merge-base against that branch will fail since it doesn't know about it. So make sure to check if we got a sha1 before comparing to the repo aosp/ revision. Fixes: ceb955851850 ("build_slider: Throw a warning when trying to build AOSP ToT") Signed-off-by: Will McVicker Change-Id: I549d3184be9048116331ef78aea3d15e88d53c03 --- build_slider.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_slider.sh b/build_slider.sh index b6131dba4eab..cfd49d4598f5 100755 --- a/build_slider.sh +++ b/build_slider.sh @@ -99,7 +99,7 @@ if [ "${EXPERIMENTAL_BUILD}" = "0" -a "${BUILD_KERNEL}" != "0" ]; then # Booting AOSP ToT does not always work; throw a warning to prevent this. REPO_SHA=$(git log -1 --pretty="format:%H" m/s-dev-gs-pixel-5.10) LOCAL_MERGE_BASE=$(git merge-base HEAD aosp/android12-5.10) - if [ "${REPO_SHA}" != "${LOCAL_MERGE_BASE}" ]; then + if [ -n "${LOCAL_MERGE_BASE}" -a "${REPO_SHA}" != "${LOCAL_MERGE_BASE}" ]; then echo "Your aosp/ directory appears to be synced to a point beyond the" echo " latest AOSP merge point. This is not supported, currently, as" echo " it is prone to errors. Please base any changes on"