Skip to content

Commit 25dd45f

Browse files
Correctly handle branches when updating repository
1 parent 3cffea7 commit 25dd45f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tools/generate_intrinsics.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def run_command(command, cwd=None):
1212
sys.exit(1)
1313

1414

15-
def clone_repository(repo_name, path, repo_url, sub_paths=None):
15+
def clone_repository(repo_name, path, repo_url, branch="master", sub_paths=None):
1616
if os.path.exists(path):
1717
while True:
1818
choice = input("There is already a `{}` folder, do you want to update it? [y/N]".format(path))
@@ -21,7 +21,7 @@ def clone_repository(repo_name, path, repo_url, sub_paths=None):
2121
return
2222
elif choice.lower() == "y":
2323
print("Updating repository...")
24-
run_command(["git", "pull", "origin"], cwd=path)
24+
run_command(["git", "pull", "origin", branch], cwd=path)
2525
return
2626
else:
2727
print("Didn't understand answer...")
@@ -209,6 +209,7 @@ def main():
209209
"llvm-project",
210210
llvm_path,
211211
"https://github.com/llvm/llvm-project",
212+
branch="main",
212213
sub_paths=["llvm/include/llvm/IR", "llvm/include/llvm/CodeGen/"],
213214
)
214215
clone_repository(

0 commit comments

Comments
 (0)