about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2025-05-10 18:02:47 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2025-05-10 18:02:47 +0200
commit25dd45f7bdbc13b2c3d9fea8f1cdb65187840879 (patch)
treed61faae2c30d6168b591d4e4c911af9a8afce753
parent3cffea796947a808fe56994b90341f143a9c7bf1 (diff)
downloadrust-25dd45f7bdbc13b2c3d9fea8f1cdb65187840879.tar.gz
rust-25dd45f7bdbc13b2c3d9fea8f1cdb65187840879.zip
Correctly handle branches when updating repository
-rw-r--r--tools/generate_intrinsics.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/generate_intrinsics.py b/tools/generate_intrinsics.py
index 8efed3e43af..181f1e501a4 100644
--- a/tools/generate_intrinsics.py
+++ b/tools/generate_intrinsics.py
@@ -12,7 +12,7 @@ def run_command(command, cwd=None):
         sys.exit(1)
 
 
-def clone_repository(repo_name, path, repo_url, sub_paths=None):
+def clone_repository(repo_name, path, repo_url, branch="master", sub_paths=None):
     if os.path.exists(path):
         while True:
             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):
                 return
             elif choice.lower() == "y":
                 print("Updating repository...")
-                run_command(["git", "pull", "origin"], cwd=path)
+                run_command(["git", "pull", "origin", branch], cwd=path)
                 return
             else:
                 print("Didn't understand answer...")
@@ -209,6 +209,7 @@ def main():
         "llvm-project",
         llvm_path,
         "https://github.com/llvm/llvm-project",
+        branch="main",
         sub_paths=["llvm/include/llvm/IR", "llvm/include/llvm/CodeGen/"],
     )
     clone_repository(