From 58678fb2b4e54d275b574a4e57a5b17ff9a820e9 Mon Sep 17 00:00:00 2001 From: Paul Bourke Date: Thu, 16 Jul 2015 18:06:13 +0000 Subject: [PATCH] Fix checking out custom refs in gen-source-tar It seems using --git-dir to execute commands on a repo different to where you currently are also inexplicably requires --work-tree (https://stackoverflow.com/questions/1386291/git-git-dir-not-working-as-expected) Change-Id: I42806e7d8a169ad9fc1878a0f4e0c03c57beb88b Closes-Bug: #1475385 --- tools/gen-source-tar.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/gen-source-tar.sh b/tools/gen-source-tar.sh index 66c04caf09..c7658d3d28 100644 --- a/tools/gen-source-tar.sh +++ b/tools/gen-source-tar.sh @@ -17,7 +17,9 @@ function fetch_source_from_git { git clone --depth=1 ${CLONE_FROM} ${TMPDIR}/${COMPONENT} else git clone ${CLONE_FROM} ${TMPDIR}/${COMPONENT} - git --git-dir ${TMPDIR}/${COMPONENT}/.git checkout ${GIT_REF} + git --git-dir ${TMPDIR}/${COMPONENT}/.git \ + --work-tree ${TMPDIR}/${COMPONENT}/ \ + checkout ${GIT_REF} fi tar -cf ${TMPDIR}/${COMPONENT}.tar -C ${TMPDIR} ${COMPONENT} }