mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-10 15:07:35 +01:00
parent
655ed2255a
commit
cc564af44e
@ -299,15 +299,17 @@ def cloneRepo(urlstr, ref=None, recursive=False):
|
|||||||
gitUrl = generateGitURL(urlstr)
|
gitUrl = generateGitURL(urlstr)
|
||||||
print("Cloning from " + gitUrl)
|
print("Cloning from " + gitUrl)
|
||||||
repo = git.Repo.clone_from(gitUrl, gitDir, \
|
repo = git.Repo.clone_from(gitUrl, gitDir, \
|
||||||
progress=None, env=None, depth=1, recursive=recursive, kill_after_timeout=15)
|
progress=None, env=None, depth=1, recursive=recursive, kill_after_timeout=15, b=ref)
|
||||||
|
|
||||||
if ref is not None:
|
|
||||||
repo.create_head("myhead", ref).checkout()
|
|
||||||
return gitDir, repo
|
return gitDir, repo
|
||||||
|
|
||||||
except GitCommandError as e:
|
except GitCommandError as e:
|
||||||
# This is needed to stop the backtrace being weird
|
# This is needed to stop the backtrace being weird
|
||||||
err = e.stderr
|
err = e.stderr
|
||||||
|
|
||||||
|
except gitdb.exc.BadName as e:
|
||||||
|
err = "Unable to find the reference " + (ref or "?") + "\n" + e.stderr
|
||||||
|
|
||||||
raise TaskError(err.replace("stderr: ", "") \
|
raise TaskError(err.replace("stderr: ", "") \
|
||||||
.replace("Cloning into '" + gitDir + "'...", "") \
|
.replace("Cloning into '" + gitDir + "'...", "") \
|
||||||
.strip())
|
.strip())
|
||||||
|
Loading…
Reference in New Issue
Block a user