diff options
author | Yu Ke <ke.yu@intel.com> | 2011-05-26 15:37:56 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-05-27 17:19:55 +0100 |
commit | c0eb89054aef4957966f98b44e7f3cce14fb337a (patch) | |
tree | 6e29b1dd43ee9a0a4bdfca1ea8417155b178f6f0 | |
parent | d424ecd751f80a7aecec26e1a0cbd2a1b38e076b (diff) | |
download | bitbake-c0eb89054aef4957966f98b44e7f3cce14fb337a.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]
Signed-off-by: Yu Ke <ke.yu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | lib/bb/fetch2/git.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py index 3b8965e49..ae44a49b2 100644 --- a/lib/bb/fetch2/git.py +++ b/lib/bb/fetch2/git.py @@ -213,8 +213,11 @@ class Git(FetchMethod): runfetchcmd("git clone -s -n %s %s" % (ud.clonedir, destdir), d) if not ud.nocheckout: os.chdir(destdir) - runfetchcmd("%s read-tree %s%s" % (ud.basecmd, ud.revisions[ud.names[0]], readpathspec), d) - runfetchcmd("%s checkout-index -q -f -a" % ud.basecmd, d) + if subdir != "": + runfetchcmd("%s read-tree %s%s" % (ud.basecmd, ud.revisions[ud.names[0]], readpathspec), d) + runfetchcmd("%s checkout-index -q -f -a" % ud.basecmd, d) + else: + runfetchcmd("%s checkout %s" % (ud.basecmd, ud.revisions[ud.names[0]]), d) return True def clean(self, ud, d): |