Skip to content

Commit 5ac521c

Browse files
committed
Fix benchsuite issue with newer versions of git
1 parent 1b77ac6 commit 5ac521c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

benches/benchsuite/src/lib.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,15 @@ impl Fixtures {
125125
}
126126
} else {
127127
fs::create_dir_all(&index).unwrap();
128-
git("init --bare");
128+
// git 2.48.0 changed the behavior of setting HEAD when doing a
129+
// fetch, so let's just force it to match
130+
// crates.io-index-archive's default branch. This also accounts
131+
// for users who may override init.defaultBranch.
132+
git("init --bare --initial-branch=main");
129133
git("remote add origin https://github.com/rust-lang/crates.io-index-archive");
130134
}
131135
git(&format!("fetch origin {}", CRATES_IO_COMMIT));
132-
git("branch -f master FETCH_HEAD");
136+
git("branch -f main FETCH_HEAD");
133137
}
134138

135139
/// This unpacks the compressed workspace skeletons into tmp/workspaces.

0 commit comments

Comments
 (0)