]> code.ossystems Code Review - openembedded-core.git/commitdiff
kernel-yocto: set master branch to a defined SRCREV
authorBruce Ashfield <bruce.ashfield@windriver.com>
Wed, 22 Aug 2012 05:18:05 +0000 (01:18 -0400)
committerScott Garman <scott.a.garman@intel.com>
Fri, 24 Aug 2012 07:46:57 +0000 (00:46 -0700)
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>
meta/classes/kernel-yocto.bbclass

index d859d763d4c0e20fbcac380f74ca7b3e0f6d3b8d..e6758cfa42ab829c97e72f49d24ca41a73ccd6e9 100644 (file)
@@ -270,11 +270,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