diff options
Diffstat (limited to 'bitbake/lib/bb/fetch2')
-rw-r--r-- | bitbake/lib/bb/fetch2/git.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index 0abd67924b..31fd8a7206 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py | |||
@@ -279,8 +279,15 @@ class Git(FetchMethod): | |||
279 | if subdir != "": | 279 | if subdir != "": |
280 | runfetchcmd("%s read-tree %s%s" % (ud.basecmd, ud.revisions[ud.names[0]], readpathspec), d) | 280 | runfetchcmd("%s read-tree %s%s" % (ud.basecmd, ud.revisions[ud.names[0]], readpathspec), d) |
281 | runfetchcmd("%s checkout-index -q -f -a" % ud.basecmd, d) | 281 | runfetchcmd("%s checkout-index -q -f -a" % ud.basecmd, d) |
282 | elif not ud.nobranch: | ||
283 | branchname = ud.branches[ud.names[0]] | ||
284 | runfetchcmd("%s checkout -B %s %s" % (ud.basecmd, branchname, \ | ||
285 | ud.revisions[ud.names[0]]), d) | ||
286 | runfetchcmd("%s branch --set-upstream %s origin/%s" % (ud.basecmd, branchname, \ | ||
287 | branchname), d) | ||
282 | else: | 288 | else: |
283 | runfetchcmd("%s checkout %s" % (ud.basecmd, ud.revisions[ud.names[0]]), d) | 289 | runfetchcmd("%s checkout %s" % (ud.basecmd, ud.revisions[ud.names[0]]), d) |
290 | |||
284 | return True | 291 | return True |
285 | 292 | ||
286 | def clean(self, ud, d): | 293 | def clean(self, ud, d): |