def ensure_pr_fetch():
 modified = False
 remotes = git.remote().splitlines()
 if (u'edx' not in remotes):
  git.remote(u'add', u'edx', u'https://github.com/edx/edx-platform.git')
  modified = True
 edx_fetches = git.config(u'remote.edx.fetch', get_all=True).splitlines()
 pr_fetch = u'+refs/pull/*/head:refs/remotes/edx/pr/*'
 if (pr_fetch not in edx_fetches):
  git.config(u'remote.edx.fetch', pr_fetch, add=True)
  modified = True
 git.fetch(u'edx')
 return modified

def ensure_pr_fetch ( ) : modified = False remotes = git . remote ( ) . splitlines ( ) if ( u'edx' not in remotes ) : git . remote ( u'add' , u'edx' , u'https://github.com/edx/edx-platform.git' ) modified = True edx_fetches = git . config ( u'remote.edx.fetch' , get_all = True ) . splitlines ( ) pr_fetch = u'+refs/pull/*/head:refs/remotes/edx/pr/*' if ( pr_fetch not in edx_fetches ) : git . config ( u'remote.edx.fetch' , pr_fetch , add = True ) modified = True git . fetch ( u'edx' ) return modified
make sure that the git repository contains a remote called "edx" that has two fetch urls; one for the main codebase .