Skip to content

Commit c97dca6

Browse files
authored
Rollup merge of #142374 - Kobzol:fix-newline, r=tmiasko
Fix missing newline trim in bootstrap Fixes [this comment](https://github.com/rust-lang/rust/pull/141909/files#r2140632918). Fixes: #142350
2 parents f417620 + 87b068c commit c97dca6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/bootstrap/src/core/config/config.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1389,7 +1389,8 @@ impl Config {
13891389
// If there is a tag named after the current branch, git will try to disambiguate by prepending `heads/` to the branch name.
13901390
// This syntax isn't accepted by `branch.{branch}`. Strip it.
13911391
let branch = current_branch.stdout();
1392-
let branch = branch.strip_prefix("heads/").unwrap_or(&branch);
1392+
let branch = branch.trim();
1393+
let branch = branch.strip_prefix("heads/").unwrap_or(branch);
13931394
git.arg("-c").arg(format!("branch.{branch}.remote=origin"));
13941395
}
13951396
git.args(["submodule", "update", "--init", "--recursive", "--depth=1"]);

0 commit comments

Comments
 (0)