1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-09 05:29:32 +00:00

kernel-yocto: use cat-file instead of git-show

Parsing the output of git show is error prone, since it changes based on
the type of issue with bad comit IDs. Since the output is no longer used
in the case of a valid ref, we can switch to git-cat-file and  simply
check the return code.

(From OE-Core rev: 228c05013fe691321ec00467d8d0c0bb64dd175c)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Bruce Ashfield
2014-03-17 14:00:15 -04:00
committed by Richard Purdie
parent 6b294a0489
commit 4e96983a3a
+4 -4
View File
@@ -321,8 +321,8 @@ do_validate_branches() {
fi fi
fi fi
ref=`git show ${machine_srcrev} 2>&1 | head -n1 || true` git cat-file -t ${machine_srcrev} > /dev/null
if [ "$ref" = "fatal: bad object ${target_meta_head}" ]; then if [ if $? -ne 0 ]; then
echo "ERROR ${machine_srcrev} is not a valid commit ID." echo "ERROR ${machine_srcrev} is not a valid commit ID."
echo "The kernel source tree may be out of sync" echo "The kernel source tree may be out of sync"
exit 1 exit 1
@@ -358,8 +358,8 @@ do_validate_branches() {
git show-ref --quiet --verify -- "refs/heads/${KMETA}" git show-ref --quiet --verify -- "refs/heads/${KMETA}"
if [ $? -eq 0 ] && [ "${target_meta_head}" != "AUTOINC" ]; then if [ $? -eq 0 ] && [ "${target_meta_head}" != "AUTOINC" ]; then
if [ "$meta_head" != "$target_meta_head" ]; then if [ "$meta_head" != "$target_meta_head" ]; then
ref=`git show ${target_meta_head} 2>&1 | head -n1 || true` git cat-file -t ${target_meta_head} > /dev/null
if [ "$ref" = "fatal: bad object ${target_meta_head}" ]; then if [ $? -ne 0 ]; then
echo "ERROR ${target_meta_head} is not a valid commit ID" echo "ERROR ${target_meta_head} is not a valid commit ID"
echo "The kernel source tree may be out of sync" echo "The kernel source tree may be out of sync"
exit 1 exit 1