about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2023-01-13 14:41:07 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2023-01-13 15:29:26 +0000
commit890c61216a726a6ecad41e1f8146c169aa91812d (patch)
treefb8f8898f9ec5cc17467f393731fb4c99651a5ed
parent9a15db6dd0baba5423455012cf170d0f3ca89c26 (diff)
downloadrust-890c61216a726a6ecad41e1f8146c169aa91812d.tar.gz
rust-890c61216a726a6ecad41e1f8146c169aa91812d.zip
Set core.autocrlf=false in the build system instead of CI config
-rw-r--r--.github/workflows/main.yml4
-rw-r--r--build_system/utils.rs9
2 files changed, 8 insertions, 5 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 7dbc8e76efd..f1badb792cd 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -91,10 +91,6 @@ jobs:
         sudo apt-get update
         sudo apt-get install -y gcc-s390x-linux-gnu qemu-user
 
-    - name: Windows setup
-      if: matrix.os == 'windows-latest'
-      run: git config --global core.autocrlf false
-
     - name: Use sparse cargo registry
       run: |
         cat >> ~/.cargo/config.toml <<EOF
diff --git a/build_system/utils.rs b/build_system/utils.rs
index 6d0d9b56514..afbb1b0e5be 100644
--- a/build_system/utils.rs
+++ b/build_system/utils.rs
@@ -196,7 +196,14 @@ pub(crate) fn hyperfine_command(
 #[must_use]
 pub(crate) fn git_command<'a>(repo_dir: impl Into<Option<&'a Path>>, cmd: &str) -> Command {
     let mut git_cmd = Command::new("git");
-    git_cmd.arg("-c").arg("user.name=Dummy").arg("-c").arg("user.email=dummy@example.com").arg(cmd);
+    git_cmd
+        .arg("-c")
+        .arg("user.name=Dummy")
+        .arg("-c")
+        .arg("user.email=dummy@example.com")
+        .arg("-c")
+        .arg("core.autocrlf=false")
+        .arg(cmd);
     if let Some(repo_dir) = repo_dir.into() {
         git_cmd.current_dir(repo_dir);
     }