Skip to content

Commit a45924c

Browse files
committed
Explicitly provide dummy git author name and email
This avoids the need to tell git beforehand about your name and email
1 parent 08ba5d4 commit a45924c

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

.cirrus.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ task:
1212
folder: target
1313
prepare_script:
1414
- . $HOME/.cargo/env
15-
- git config --global user.email "[email protected]"
16-
- git config --global user.name "User"
1715
- ./y.rs prepare
1816
test_script:
1917
- . $HOME/.cargo/env

.github/workflows/main.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,7 @@ jobs:
9090
sudo apt-get install -y gcc-s390x-linux-gnu qemu-user
9191
9292
- name: Prepare dependencies
93-
run: |
94-
git config --global user.email "[email protected]"
95-
git config --global user.name "User"
96-
./y.rs prepare
93+
run: ./y.rs prepare
9794

9895
- name: Build without unstable features
9996
env:
@@ -183,8 +180,6 @@ jobs:
183180

184181
- name: Prepare dependencies
185182
run: |
186-
git config --global user.email "[email protected]"
187-
git config --global user.name "User"
188183
git config --global core.autocrlf false
189184
rustc y.rs -o y.exe -g
190185
./y.exe prepare

build_system/prepare.rs

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,16 @@ fn init_git_repo(repo_dir: &Path) {
180180
spawn_and_wait(git_add_cmd);
181181

182182
let mut git_commit_cmd = Command::new("git");
183-
git_commit_cmd.arg("commit").arg("-m").arg("Initial commit").arg("-q").current_dir(repo_dir);
183+
git_commit_cmd
184+
.arg("-c")
185+
.arg("user.name=Dummy")
186+
.arg("-c")
187+
188+
.arg("commit")
189+
.arg("-m")
190+
.arg("Initial commit")
191+
.arg("-q")
192+
.current_dir(repo_dir);
184193
spawn_and_wait(git_commit_cmd);
185194
}
186195

@@ -216,7 +225,15 @@ fn apply_patches(dirs: &Dirs, crate_name: &str, target_dir: &Path) {
216225
patch.file_name().unwrap()
217226
);
218227
let mut apply_patch_cmd = Command::new("git");
219-
apply_patch_cmd.arg("am").arg(patch).arg("-q").current_dir(target_dir);
228+
apply_patch_cmd
229+
.arg("-c")
230+
.arg("user.name=Dummy")
231+
.arg("-c")
232+
233+
.arg("am")
234+
.arg(patch)
235+
.arg("-q")
236+
.current_dir(target_dir);
220237
spawn_and_wait(apply_patch_cmd);
221238
}
222239
}

0 commit comments

Comments
 (0)