diff options
author | Bruce Ashfield <bruce.ashfield@windriver.com> | 2012-08-22 01:18:05 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-09-28 16:53:04 +0100 |
commit | 33921847a2dd6d9d6e382b55337492e97ebc666b (patch) | |
tree | ff0d888090ec8f34deaa79ed9ac799866eb45dbe /meta/classes/kernel-yocto.bbclass | |
parent | 5427f5d70f188c9bd4cc22795560ae967ff766d4 (diff) | |
download | poky-33921847a2dd6d9d6e382b55337492e97ebc666b.tar.gz |
kernel-yocto: set master branch to a defined SRCREV
To support custom repositories that set a SRCREV and that only have
a single master branch, do_validate_branches needs a special case
for 'master'. We can't delete and recreate the branch, since you
cannot delete the current branch, instead we must reset the branch
to the proper SRCREV.
(From OE-Core rev: 3a8dc0a01d2756bb8f51afccad772fca1dc48af3)
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/kernel-yocto.bbclass')
-rw-r--r-- | meta/classes/kernel-yocto.bbclass | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass index d859d763d4..e6758cfa42 100644 --- a/meta/classes/kernel-yocto.bbclass +++ b/meta/classes/kernel-yocto.bbclass | |||
@@ -270,11 +270,15 @@ do_validate_branches() { | |||
270 | # SRCREV (if it isn't the current HEAD of that branch) | 270 | # SRCREV (if it isn't the current HEAD of that branch) |
271 | git checkout -q master | 271 | git checkout -q master |
272 | for b in $containing_branches; do | 272 | for b in $containing_branches; do |
273 | branch_head=`git show-ref -s --heads ${b}` | 273 | branch_head=`git show-ref -s --heads ${b}` |
274 | if [ "$branch_head" != "$target_branch_head" ]; then | 274 | if [ "$branch_head" != "$target_branch_head" ]; then |
275 | echo "[INFO] Setting branch $b to ${target_branch_head}" | 275 | echo "[INFO] Setting branch $b to ${target_branch_head}" |
276 | git branch -D $b > /dev/null | 276 | if [ "$b" == "master" ]; then |
277 | git branch $b $target_branch_head > /dev/null | 277 | git reset --hard $target_branch_head > /dev/null |
278 | else | ||
279 | git branch -D $b > /dev/null | ||
280 | git branch $b $target_branch_head > /dev/null | ||
281 | fi | ||
278 | fi | 282 | fi |
279 | done | 283 | done |
280 | 284 | ||