summaryrefslogtreecommitdiffstats
path: root/lib/bb/fetch2/git.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-02 12:48:32 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-10 23:36:47 +0000
commitcbbcabe119ac59b1ceedd2491ab77f00d5d17d42 (patch)
tree8eb40339947acb975385274222ba5a5d5dffde50 /lib/bb/fetch2/git.py
parentadb78a15e60a733dd2636f332e55f1e1bc7107ac (diff)
downloadbitbake-cbbcabe119ac59b1ceedd2491ab77f00d5d17d42.tar.gz
bitbake/fetch2/git: Add nocheckout option to disable checkouts and always add scm data to checkouts
(From Poky rev: 05048e0f9168ceb7d66f6ac79dcae42f1e696826) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/fetch2/git.py')
-rw-r--r--lib/bb/fetch2/git.py21
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index 0a1818f82..6e078a1f7 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -53,6 +53,10 @@ class Git(Fetch):
else:
ud.proto = "rsync"
+ ud.nocheckout = False
+ if 'nocheckout' in ud.parm:
+ ud.nocheckout = True
+
ud.branch = ud.parm.get("branch", "master")
gitsrcname = '%s%s' % (ud.host, ud.path.replace('/', '.'))
@@ -207,16 +211,15 @@ class Git(Fetch):
if os.path.exists(destdir):
bb.utils.prunedir(destdir)
- if 'fullclone' in ud.parm:
- runfetchcmd("git clone -s -n %s %s" % (ud.clonedir, destdir), d)
- if os.path.exists("%s/.git/refs/remotes/origin" % ud.clonedir):
- runfetchcmd("cp -af %s/.git/refs/remotes/origin/* %s/.git/refs/remotes/origin/" %(ud.clonedir, destdir), d)
- if os.path.exists("%s/.git/packed-refs" % ud.clonedir):
- runfetchcmd("cp -af %s/.git/packed-refs %s/.git/" %(ud.clonedir, destdir), d)
- else:
- os.chdir(ud.clonedir)
+ runfetchcmd("git clone -s -n %s %s" % (ud.clonedir, destdir), d)
+ if os.path.exists("%s/.git/refs/remotes/origin" % ud.clonedir):
+ runfetchcmd("cp -af %s/.git/refs/remotes/origin/* %s/.git/refs/remotes/origin/" %(ud.clonedir, destdir), d)
+ if os.path.exists("%s/.git/packed-refs" % ud.clonedir):
+ runfetchcmd("cp -af %s/.git/packed-refs %s/.git/" %(ud.clonedir, destdir), d)
+ if not ud.nocheckout:
+ os.chdir(destdir)
runfetchcmd("%s read-tree %s%s" % (ud.basecmd, ud.tag, readpathspec), d)
- runfetchcmd("%s checkout-index -q -f --prefix=%s -a" % (ud.basecmd, destdir), d)
+ runfetchcmd("%s checkout-index -q -f -a" % ud.basecmd, d)
return True
def supports_srcrev(self):