diff options
author | Bruce Ashfield <bruce.ashfield@windriver.com> | 2012-08-22 01:18:05 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-08-25 14:44:01 +0100 |
commit | de5bb5879fa3282c46dc1ede36af34eaab8f647f (patch) | |
tree | e5161b94a1980e0c30a762fccba58bea4d18bf76 /meta/classes | |
parent | 4e0daf05ed04e9fb4343032c6290a379f53b89f3 (diff) | |
download | openembedded-core-de5bb5879fa3282c46dc1ede36af34eaab8f647f.tar.gz openembedded-core-de5bb5879fa3282c46dc1ede36af34eaab8f647f.tar.bz2 openembedded-core-de5bb5879fa3282c46dc1ede36af34eaab8f647f.zip |
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.
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Diffstat (limited to 'meta/classes')
-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 1b37dc781a..4328093778 100644 --- a/meta/classes/kernel-yocto.bbclass +++ b/meta/classes/kernel-yocto.bbclass @@ -273,11 +273,15 @@ do_validate_branches() { # SRCREV (if it isn't the current HEAD of that branch) git checkout -q master for b in $containing_branches; do - branch_head=`git show-ref -s --heads ${b}` + branch_head=`git show-ref -s --heads ${b}` if [ "$branch_head" != "$target_branch_head" ]; then - echo "[INFO] Setting branch $b to ${target_branch_head}" - git branch -D $b > /dev/null - git branch $b $target_branch_head > /dev/null + echo "[INFO] Setting branch $b to ${target_branch_head}" + if [ "$b" == "master" ]; then + git reset --hard $target_branch_head > /dev/null + else + git branch -D $b > /dev/null + git branch $b $target_branch_head > /dev/null + fi fi done |