about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJakub Beránek <berykubik@gmail.com>2025-06-11 18:38:29 +0200
committerJakub Beránek <berykubik@gmail.com>2025-06-11 19:05:10 +0200
commit87b068ccb7d36e494a1cb4cfd104bf782eeac088 (patch)
tree77879c55ec908dc964730697c168ae55ddb28c2b
parentbdb04d6c4fff0970bc2f1fad775bec807d9470ee (diff)
downloadrust-87b068ccb7d36e494a1cb4cfd104bf782eeac088.tar.gz
rust-87b068ccb7d36e494a1cb4cfd104bf782eeac088.zip
Fix missing newline trim in bootstrap
-rw-r--r--src/bootstrap/src/core/config/config.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
index 7f52697e6c7..c7ad36d08da 100644
--- a/src/bootstrap/src/core/config/config.rs
+++ b/src/bootstrap/src/core/config/config.rs
@@ -1402,7 +1402,8 @@ impl Config {
                 // If there is a tag named after the current branch, git will try to disambiguate by prepending `heads/` to the branch name.
                 // This syntax isn't accepted by `branch.{branch}`. Strip it.
                 let branch = current_branch.stdout();
-                let branch = branch.strip_prefix("heads/").unwrap_or(&branch);
+                let branch = branch.trim();
+                let branch = branch.strip_prefix("heads/").unwrap_or(branch);
                 git.arg("-c").arg(format!("branch.{branch}.remote=origin"));
             }
             git.args(["submodule", "update", "--init", "--recursive", "--depth=1"]);