From 192f631129e25b959d501c46c3156b7037b49c22 Mon Sep 17 00:00:00 2001 From: Saul Wold Date: Sat, 5 Feb 2011 14:11:25 -0800 Subject: fetch2/git.py: Fix problem when fetching with no origin When updating a git repo, its possible to not have an origin, so fail gracefully with a debug message. Signed-off-by: Saul Wold --- bitbake/lib/bb/fetch2/git.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index ec20d262a8..ba8126f003 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py @@ -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) -- cgit v1.2.3-54-g00ecf