]> code.ossystems Code Review - openembedded-core.git/commitdiff
linux-wrs: allow packed refs to be present
authorBruce Ashfield <bruce.ashfield@windriver.com>
Thu, 19 Aug 2010 20:37:03 +0000 (16:37 -0400)
committerRichard Purdie <rpurdie@linux.intel.com>
Fri, 20 Aug 2010 15:36:26 +0000 (16:36 +0100)
The code which creates a working tree from the source
Wind River Linux git repository manipulates the refs
to make non-tracking, local branches. packed-refs remove
the files from refs, making this code break and the builds
fail.

To fix this, if we detect the packed refs we simply create
the local refs from the remote branches.

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
meta/packages/linux/linux-wrs_git.bb

index c8d362571ffcf1e6774f9363d0131a4005e08d3f..eaa8e4447d9817dcd5a944dfc14c6b0c281e6b95 100644 (file)
@@ -65,8 +65,23 @@ do_wrlinux_checkout() {
                rm -rf ${S}
                mkdir ${S}
                mv ${WORKDIR}/.git ${S}
-               mv ${S}/.git/refs/remotes/origin/* ${S}/.git/refs/heads
-               rmdir ${S}/.git/refs/remotes/origin
+       
+               if [ -e ${S}/.git/packed-refs ]; then
+                       cd ${S}
+                       rm -f .git/refs/remotes/origin/HEAD
+IFS='
+';
+
+                       for r in `git show-ref | grep remotes`; do
+                               ref=`echo $r | cut -d' ' -f1`; 
+                               b=`echo $r | cut -d'/' -f4`;
+                               echo $ref > .git/refs/heads/$b
+                       done
+                       cd ..
+               else
+                       mv ${S}/.git/refs/remotes/origin/* ${S}/.git/refs/heads
+                       rmdir ${S}/.git/refs/remotes/origin
+               fi
        fi
        cd ${S}
        git checkout -f ${WRMACHINE}-${LINUX_KERNEL_TYPE}