diff options
-rw-r--r-- | bitbake/lib/bb/fetch2/git.py | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index 0a1818f825..6e078a1f7f 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py | |||
@@ -53,6 +53,10 @@ class Git(Fetch): | |||
53 | else: | 53 | else: |
54 | ud.proto = "rsync" | 54 | ud.proto = "rsync" |
55 | 55 | ||
56 | ud.nocheckout = False | ||
57 | if 'nocheckout' in ud.parm: | ||
58 | ud.nocheckout = True | ||
59 | |||
56 | ud.branch = ud.parm.get("branch", "master") | 60 | ud.branch = ud.parm.get("branch", "master") |
57 | 61 | ||
58 | gitsrcname = '%s%s' % (ud.host, ud.path.replace('/', '.')) | 62 | gitsrcname = '%s%s' % (ud.host, ud.path.replace('/', '.')) |
@@ -207,16 +211,15 @@ class Git(Fetch): | |||
207 | if os.path.exists(destdir): | 211 | if os.path.exists(destdir): |
208 | bb.utils.prunedir(destdir) | 212 | bb.utils.prunedir(destdir) |
209 | 213 | ||
210 | if 'fullclone' in ud.parm: | 214 | runfetchcmd("git clone -s -n %s %s" % (ud.clonedir, destdir), d) |
211 | runfetchcmd("git clone -s -n %s %s" % (ud.clonedir, destdir), d) | 215 | if os.path.exists("%s/.git/refs/remotes/origin" % ud.clonedir): |
212 | if os.path.exists("%s/.git/refs/remotes/origin" % ud.clonedir): | 216 | runfetchcmd("cp -af %s/.git/refs/remotes/origin/* %s/.git/refs/remotes/origin/" %(ud.clonedir, destdir), d) |
213 | runfetchcmd("cp -af %s/.git/refs/remotes/origin/* %s/.git/refs/remotes/origin/" %(ud.clonedir, destdir), d) | 217 | if os.path.exists("%s/.git/packed-refs" % ud.clonedir): |
214 | if os.path.exists("%s/.git/packed-refs" % ud.clonedir): | 218 | runfetchcmd("cp -af %s/.git/packed-refs %s/.git/" %(ud.clonedir, destdir), d) |
215 | runfetchcmd("cp -af %s/.git/packed-refs %s/.git/" %(ud.clonedir, destdir), d) | 219 | if not ud.nocheckout: |
216 | else: | 220 | os.chdir(destdir) |
217 | os.chdir(ud.clonedir) | ||
218 | runfetchcmd("%s read-tree %s%s" % (ud.basecmd, ud.tag, readpathspec), d) | 221 | runfetchcmd("%s read-tree %s%s" % (ud.basecmd, ud.tag, readpathspec), d) |
219 | runfetchcmd("%s checkout-index -q -f --prefix=%s -a" % (ud.basecmd, destdir), d) | 222 | runfetchcmd("%s checkout-index -q -f -a" % ud.basecmd, d) |
220 | return True | 223 | return True |
221 | 224 | ||
222 | def supports_srcrev(self): | 225 | def supports_srcrev(self): |