Change-Id: Ied117af83bb4d654d03efee856f1276bbcb85f1c
Reviewed-on: https://otctools.jf.intel.com/review/6465
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
localgit = Git(localdir)
if not localgit.bare:
localgit.pull(repo=gitpath, all_repos=True)
- localgit.fetch(repo=gitpath)
+ if gitpath and localgit.get_remote_repos().get('origin')[0] != gitpath:
+ os.system('git --git-dir=%s remote set-url origin %s' % ([localdir,
+ os.path.join(localdir, '.git')][localgit.bare], gitpath))
+ localgit.fetch(all_remotes=True)
except GitRepositoryError, gre:
print('git execption: ', gre)
shutil.rmtree(localdir)