mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-06-03 08:28:26 +00:00
ci(deps): make git clone support non-branch refs (#13787)
This commit is contained in:
6
.github/workflows/dependencies/updater.py
vendored
6
.github/workflows/dependencies/updater.py
vendored
@@ -348,7 +348,7 @@ class Git:
|
|||||||
default_branch = "master"
|
default_branch = "master"
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def clone(remote_url: str, branch: str, repo_dir: str, reclone=False):
|
def clone(remote_url: str, ref: str, repo_dir: str, reclone=False):
|
||||||
# If repo needs to be fresh
|
# If repo needs to be fresh
|
||||||
if reclone and os.path.exists(repo_dir):
|
if reclone and os.path.exists(repo_dir):
|
||||||
shutil.rmtree(repo_dir)
|
shutil.rmtree(repo_dir)
|
||||||
@@ -356,11 +356,11 @@ class Git:
|
|||||||
# Clone repo in tmp directory and checkout branch
|
# Clone repo in tmp directory and checkout branch
|
||||||
if not os.path.exists(repo_dir):
|
if not os.path.exists(repo_dir):
|
||||||
print(
|
print(
|
||||||
f"Cloning {remote_url} to {repo_dir} and checking out {branch}",
|
f"Cloning {remote_url} to {repo_dir} and checking out {ref}",
|
||||||
file=sys.stderr,
|
file=sys.stderr,
|
||||||
)
|
)
|
||||||
CommandRunner.run_or_fail(
|
CommandRunner.run_or_fail(
|
||||||
["git", "clone", "--depth=1", "-b", branch, remote_url, repo_dir],
|
["git", "clone", "--depth=1", "--revision", ref, remote_url, repo_dir],
|
||||||
stage="Clone",
|
stage="Clone",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user