Commit 04351455 authored by Tristan Gingold's avatar Tristan Gingold

Refactoring on fetch.

parent dafa13f2
......@@ -82,8 +82,8 @@ class ActionCore(Action):
result = self.git_backend.fetch(module)
elif module.source == 'gitsm':
result = self.gitsm_backend.fetch(module)
elif module.source == 'local':
result = self.local_backend.fetch(module)
else:
assert False, "unknown source"
if result is False:
raise Exception("Unable to fetch module %s", str(module.url))
module.parse_manifest()
......
......@@ -70,11 +70,9 @@ class Git(Fetcher):
os.mkdir(fetchto)
basename = path_utils.url_basename(module.url)
mod_path = os.path.join(fetchto, basename)
if not module.isfetched:
logging.info("Fetching git module %s", mod_path)
shell.run("(cd {0} && git clone {1})".format(fetchto, module.url))
else:
logging.info("Updating git module %s", mod_path)
assert not module.isfetched
logging.info("Fetching git module %s", mod_path)
shell.run("(cd {0} && git clone {1})".format(fetchto, module.url))
checkout_id = None
if module.branch is not None:
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