]> code.ossystems Code Review - openembedded-core.git/commitdiff
fetch2/git.py: Fix problem when fetching with no origin
authorSaul Wold <sgw@linux.intel.com>
Sat, 5 Feb 2011 22:11:25 +0000 (14:11 -0800)
committerSaul Wold <sgw@linux.intel.com>
Sat, 5 Feb 2011 22:14:21 +0000 (14:14 -0800)
When updating a git repo, its possible to not have an origin,
so fail gracefully with a debug message.

Signed-off-by: Saul Wold <sgw@linux.intel.com>
bitbake/lib/bb/fetch2/git.py

index ec20d262a8f6d01ba79086b86d98a5de8ed3584d..ba8126f0038a6517f5d7f592b0b80c5d58bbc5fe 100644 (file)
@@ -127,8 +127,12 @@ class Git(Fetch):
                 needupdate = True
         if needupdate:
             bb.fetch2.check_network_access(d, "git fetch %s%s" % (ud.host, ud.path))
-            runfetchcmd("%s remote prune origin" % ud.basecmd, d)
-            runfetchcmd("%s remote rm origin" % ud.basecmd, d)
+            try: 
+                runfetchcmd("%s remote prune origin" % ud.basecmd, d) 
+                runfetchcmd("%s remote rm origin" % ud.basecmd, d) 
+            except bb.fetch2.FetchError:
+                logger.debug(1, "No Origin")
+            
             runfetchcmd("%s remote add origin %s://%s%s%s" % (ud.basecmd, ud.proto, username, ud.host, ud.path), d)
             runfetchcmd("%s fetch --all -t" % ud.basecmd, d)
             runfetchcmd("%s prune-packed" % ud.basecmd, d)