From 55dc9279c8707a095f058c0e952ef104ee2cbb1d Mon Sep 17 00:00:00 2001 From: Ed Bartosh Date: Wed, 23 Sep 2015 15:34:55 -0700 Subject: bitbake: toaster: fix bug in resetting git repository git reset --hard should be given either commit id or origin/ to work properly. Without this fix git will complain that origin/ does not exist. [YOCTO #7505] (Bitbake rev: ec05beff7d1b06e4df98199925c7102f5684f4e0) Signed-off-by: Ed Bartosh Signed-off-by: brian avery Signed-off-by: Richard Purdie --- bitbake/lib/toaster/bldcontrol/localhostbecontroller.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bitbake/lib/toaster/bldcontrol') diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py index e9f8c2a7ec..f1707182a3 100644 --- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py +++ b/bitbake/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")): -- cgit v1.2.3-54-g00ecf