From e7e01e7831faf2d20fae13f356f58368c0ec99c8 Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Thu, 19 Aug 2010 16:37:03 -0400 Subject: linux-wrs: allow packed refs to be present 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 --- meta/packages/linux/linux-wrs_git.bb | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'meta/packages') diff --git a/meta/packages/linux/linux-wrs_git.bb b/meta/packages/linux/linux-wrs_git.bb index c8d362571..eaa8e4447 100644 --- a/meta/packages/linux/linux-wrs_git.bb +++ b/meta/packages/linux/linux-wrs_git.bb @@ -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} -- cgit v1.2.3