summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/git.py
diff options
context:
space:
mode:
authorYu Ke <ke.yu@intel.com>2011-05-26 15:37:56 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-05-27 17:55:50 +0100
commita667251041170dbc2f7d6fa72176ca676f68f857 (patch)
treea2fe787016249a7e45c599688f56ff795140a4d0 /bitbake/lib/bb/fetch2/git.py
parent3466f2193a0668e2bae7822a5b864e4d43561c2e (diff)
downloadpoky-a667251041170dbc2f7d6fa72176ca676f68f857.tar.gz
fetch2/git: enhance the unpack by using "git checkout"
current git fetcher unpack method only checkout index and working tree, but did not did not update the git branch in ref/heads, so user may not get right info in ${S} by using git. this patch enhance the unpack by using git checkout to fix this issue. Fix bug [YOCTO #1089] (Bitbake rev: c0eb89054aef4957966f98b44e7f3cce14fb337a) Signed-off-by: Yu Ke <ke.yu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2/git.py')
-rw-r--r--bitbake/lib/bb/fetch2/git.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index 3b8965e49c..ae44a49b2a 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -213,8 +213,11 @@ class Git(FetchMethod):
213 runfetchcmd("git clone -s -n %s %s" % (ud.clonedir, destdir), d) 213 runfetchcmd("git clone -s -n %s %s" % (ud.clonedir, destdir), d)
214 if not ud.nocheckout: 214 if not ud.nocheckout:
215 os.chdir(destdir) 215 os.chdir(destdir)
216 runfetchcmd("%s read-tree %s%s" % (ud.basecmd, ud.revisions[ud.names[0]], readpathspec), d) 216 if subdir != "":
217 runfetchcmd("%s checkout-index -q -f -a" % ud.basecmd, d) 217 runfetchcmd("%s read-tree %s%s" % (ud.basecmd, ud.revisions[ud.names[0]], readpathspec), d)
218 runfetchcmd("%s checkout-index -q -f -a" % ud.basecmd, d)
219 else:
220 runfetchcmd("%s checkout %s" % (ud.basecmd, ud.revisions[ud.names[0]]), d)
218 return True 221 return True
219 222
220 def clean(self, ud, d): 223 def clean(self, ud, d):