summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/kernel-yocto.bbclass15
1 files changed, 8 insertions, 7 deletions
diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index 45918d65aa..724e5cd475 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -258,12 +258,6 @@ do_validate_branches() {
258 return 258 return
259 fi 259 fi
260 260
261 containing_branches=`git branch --contains $target_branch_head | sed 's/^..//'`
262 if [ -z "$containing_branches" ]; then
263 echo "ERROR: SRCREV was set to \"$target_branch_head\", but no branches"
264 echo " contain this commit"
265 exit 1
266 fi
267 ref=`git show ${target_branch_head} 2>&1 | head -n1 || true` 261 ref=`git show ${target_branch_head} 2>&1 | head -n1 || true`
268 if [ "$ref" = "fatal: bad object ${target_meta_head}" ]; then 262 if [ "$ref" = "fatal: bad object ${target_meta_head}" ]; then
269 echo "ERROR ${target_branch_head} is not a valid commit ID." 263 echo "ERROR ${target_branch_head} is not a valid commit ID."
@@ -271,6 +265,13 @@ do_validate_branches() {
271 exit 1 265 exit 1
272 fi 266 fi
273 267
268 containing_branches=`git branch --contains $target_branch_head | sed 's/^..//'`
269 if [ -z "$containing_branches" ]; then
270 echo "ERROR: SRCREV was set to \"$target_branch_head\", but no branches"
271 echo " contain this commit"
272 exit 1
273 fi
274
274 # force the SRCREV in each branch that contains the specified 275 # force the SRCREV in each branch that contains the specified
275 # SRCREV (if it isn't the current HEAD of that branch) 276 # SRCREV (if it isn't the current HEAD of that branch)
276 git checkout -q master 277 git checkout -q master
@@ -278,7 +279,7 @@ do_validate_branches() {
278 branch_head=`git show-ref -s --heads ${b}` 279 branch_head=`git show-ref -s --heads ${b}`
279 if [ "$branch_head" != "$target_branch_head" ]; then 280 if [ "$branch_head" != "$target_branch_head" ]; then
280 echo "[INFO] Setting branch $b to ${target_branch_head}" 281 echo "[INFO] Setting branch $b to ${target_branch_head}"
281 if [ "$b" == "master" ]; then 282 if [ "$b" = "master" ]; then
282 git reset --hard $target_branch_head > /dev/null 283 git reset --hard $target_branch_head > /dev/null
283 else 284 else
284 git branch -D $b > /dev/null 285 git branch -D $b > /dev/null