Skip to content

Commit 598755d

Browse files
committed
fix download-llvm logic for subtree sync branches
1 parent 9c67cec commit 598755d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/build_helper/src/git.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,18 @@ pub fn get_closest_merge_commit(
150150
}
151151
};
152152

153+
// Now that rust-lang/rust is the only repo using bors, we can search the entire
154+
// history for a bors commit, not just "first parents". This is crucial to make
155+
// this logic work when the user has currently checked out a subtree sync branch.
156+
// At the same time, we use this logic in CI where only a tiny part of the history
157+
// is even checked out, making this kind of history search very fragile. It turns
158+
// out that by adding `--diff-merges=first-parent`, we get a usable reply
159+
// even for sparse checkouts: it will just return the most recent bors commit.
153160
git.args([
154161
"rev-list",
155162
&format!("--author={}", config.git_merge_commit_email),
156163
"-n1",
157-
"--first-parent",
164+
"--diff-merges=first-parent",
158165
&merge_base,
159166
]);
160167

0 commit comments

Comments
 (0)