diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2015-07-09 00:18:01 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-07-12 22:50:41 +0100 |
commit | 518abb731ce27a606f0a17c26b324b9d57abfe18 (patch) | |
tree | 613676cba68f75e17e9ae4fd2ffc5b8ca2d09b05 | |
parent | 61fbff2cd43720037de0266b73d5460576ed07e8 (diff) | |
download | poky-518abb731ce27a606f0a17c26b324b9d57abfe18.tar.gz |
bitbake: git.py: create a branch when checkout
* Create a branch and named as upstream branch when checkout source
* Set the branch to track remote branch.
(Bitbake rev: 1ba20e4fe9c884515b200589fe379ad5eeda10bd)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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): |