summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2015-09-23 15:34:55 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-29 14:11:06 +0100
commitec05beff7d1b06e4df98199925c7102f5684f4e0 (patch)
treeeef19c4d47cdcff672d688f32a49c3642553aa8b
parentf3641a8422e67890410594453b8baf362c27df2b (diff)
downloadbitbake-ec05beff7d1b06e4df98199925c7102f5684f4e0.zip
toaster: fix bug in resetting git repository
git reset --hard should be given either commit id or origin/<ref name> to work properly. Without this fix git will complain that origin/<commit id> does not exist. [YOCTO #7505] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/toaster/bldcontrol/localhostbecontroller.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/toaster/bldcontrol/localhostbecontroller.py b/lib/toaster/bldcontrol/localhostbecontroller.py
index e9f8c2a7..f1707182 100644
--- a/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -268,7 +268,8 @@ class LocalhostBEController(BuildEnvironmentController):
# branch magic name "HEAD" will inhibit checkout
if commit != "HEAD":
logger.debug("localhostbecontroller: checking out commit %s to %s " % (commit, localdirname))
- self._shellcmd('git fetch --all && git reset --hard "origin/%s"' % commit, localdirname)
+ ref = commit if re.match('^[a-fA-F0-9]+$', commit) else 'origin/%s' % commit
+ self._shellcmd('git fetch --all && git reset --hard "%s"' % ref, localdirname)
# take the localdirname as poky dir if we can find the oe-init-build-env
if self.pokydirname is None and os.path.exists(os.path.join(localdirname, "oe-init-build-env")):