Commit 04351455 authored by Tristan Gingold's avatar Tristan Gingold

Refactoring on fetch.

parent dafa13f2
...@@ -82,8 +82,8 @@ class ActionCore(Action): ...@@ -82,8 +82,8 @@ class ActionCore(Action):
result = self.git_backend.fetch(module) result = self.git_backend.fetch(module)
elif module.source == 'gitsm': elif module.source == 'gitsm':
result = self.gitsm_backend.fetch(module) result = self.gitsm_backend.fetch(module)
elif module.source == 'local': else:
result = self.local_backend.fetch(module) assert False, "unknown source"
if result is False: if result is False:
raise Exception("Unable to fetch module %s", str(module.url)) raise Exception("Unable to fetch module %s", str(module.url))
module.parse_manifest() module.parse_manifest()
......
...@@ -70,11 +70,9 @@ class Git(Fetcher): ...@@ -70,11 +70,9 @@ class Git(Fetcher):
os.mkdir(fetchto) os.mkdir(fetchto)
basename = path_utils.url_basename(module.url) basename = path_utils.url_basename(module.url)
mod_path = os.path.join(fetchto, basename) mod_path = os.path.join(fetchto, basename)
if not module.isfetched: assert not module.isfetched
logging.info("Fetching git module %s", mod_path) logging.info("Fetching git module %s", mod_path)
shell.run("(cd {0} && git clone {1})".format(fetchto, module.url)) shell.run("(cd {0} && git clone {1})".format(fetchto, module.url))
else:
logging.info("Updating git module %s", mod_path)
checkout_id = None checkout_id = None
if module.branch is not None: if module.branch is not None:
checkout_id = module.branch checkout_id = module.branch
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment