Skip to content

Commit 28d0d0c

Browse files
committed
Fix commit check
1 parent f4210fc commit 28d0d0c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/bootstrap/native.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,14 @@ pub(crate) fn update_llvm_submodule(build: &Build) {
107107
}
108108

109109
// check_submodule
110+
let buf;
110111
let checked_out = if build.config.fast_submodules {
111-
Some(output(
112+
buf = output(
112113
Command::new("git")
113114
.args(&["rev-parse", "HEAD"])
114115
.current_dir(build.config.src.join(llvm_project)),
115-
))
116+
);
117+
Some(buf.trim_end())
116118
} else {
117119
None
118120
};
@@ -124,8 +126,10 @@ pub(crate) fn update_llvm_submodule(build: &Build) {
124126
.arg(llvm_project)
125127
.current_dir(&build.config.src),
126128
);
127-
let hash =
128-
recorded.split(' ').nth(2).unwrap_or_else(|| panic!("unexpected output `{}`", recorded));
129+
let hash = recorded
130+
.split_whitespace()
131+
.nth(2)
132+
.unwrap_or_else(|| panic!("unexpected output `{}`", recorded));
129133

130134
// update_submodule
131135
if let Some(llvm_hash) = checked_out {

0 commit comments

Comments
 (0)