summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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):