Skip to contentSkip to conversation

toaster: fix checking of repository url

PATCH In review Ed Bartosh 2 participants 2 messages Sep 14, 2016 – Sep 16, 2016

lore
Share & tools
lore

Ed Bartosh

author
#0 lore raw

PATCH 1/1 toaster: fix checking of repository url

Toaster checks gir repository url is the same as locally cloned before checking it out to existing local clone. This check can be skipped if commit is 'HEAD' as in this case repository is not hard reset to commit, so the local clone won't be changed.

[YOCTO #10163]

---
 bitbake/lib/toaster/bldcontrol/localhostbecontroller.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
bitbake/lib/toaster/bldcontrol/localhostbecontroller.py +1 -1
index 39de6dd..a64e89b 100644
@@ -156,7 +156,7 @@ class LocalhostBEController(BuildEnvironmentController):
                 try:
                     localremotes = self._shellcmd("git remote -v",
                                                   localdirname)
-                    if not giturl in localremotes:
+                    if not giturl in localremotes and commit != 'HEAD':
                         raise BuildSetupException("Existing git repository at %s, but with different remotes ('%s', expected '%s'). Toaster will not continue out of fear of damaging something." % (localdirname, ", ".join(localremotes.split("\n")), giturl))
                 except ShellCmdException:
                     # our localdirname might not be a git repository
Signature · 1 line
2.1.4
#1 lore raw

Thanks - send to bitbake-devel and applied to toaster-next

Quoted 25 lines · Ed Bartosh

Toaster checks gir repository url is the same as locally cloned before checking it out to existing local clone. This check can be skipped if commit is 'HEAD' as in this case repository is not hard reset to commit, so the local clone won't be changed.

[YOCTO #10163]

---
  bitbake/lib/toaster/bldcontrol/localhostbecontroller.py | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
bitbake/lib/toaster/bldcontrol/localhostbecontroller.py +1 -1
index 39de6dd..a64e89b 100644
@@ -156,7 +156,7 @@ class LocalhostBEController(BuildEnvironmentController):
                  try:
                      localremotes = self._shellcmd("git remote -v",
                                                    localdirname)
-                    if not giturl in localremotes:
+                    if not giturl in localremotes and commit != 'HEAD':
                          raise BuildSetupException("Existing git repository at %s, but with different remotes ('%s', expected '%s'). Toaster will not continue out of fear of damaging something." % (localdirname, ", ".join(localremotes.split("\n")), giturl))
                  except ShellCmdException:
                      # our localdirname might not be a git repository