Commit 8519d586 by Yap Sok Ann

git: Don't add --branch while cloning if the version is a SHA-1 hash.

parent 9f8cdac0
...@@ -122,8 +122,9 @@ def clone(git_path, module, repo, dest, remote, depth, version): ...@@ -122,8 +122,9 @@ def clone(git_path, module, repo, dest, remote, depth, version):
pass pass
os.chdir(dest_dirname) os.chdir(dest_dirname)
cmd = [ git_path, 'clone', '-o', remote, '--recursive' ] cmd = [ git_path, 'clone', '-o', remote, '--recursive' ]
if version and version != 'HEAD': if is_remote_branch(git_path, module, dest, repo, version) \
cmd.extend([ '--branch', str(version) ]) or is_remote_tag(git_path, module, dest, repo, version):
cmd.extend([ '--branch', version ])
if depth: if depth:
cmd.extend([ '--depth', str(depth) ]) cmd.extend([ '--depth', str(depth) ])
cmd.extend([ repo, dest ]) cmd.extend([ repo, dest ])
......
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