diff --git a/crates/git_ui/src/branch_picker.rs b/crates/git_ui/src/branch_picker.rs index aaa69373636a3c0dfd01bdb823f4cfcb70f323a5..5f51f8e2db87703d8c05acb2773dab5f7af1d91d 100644 --- a/crates/git_ui/src/branch_picker.rs +++ b/crates/git_ui/src/branch_picker.rs @@ -221,6 +221,7 @@ impl BranchListDelegate { let Some(repo) = self.repo.clone() else { return; }; + let new_branch_name = new_branch_name.to_string().replace(' ', "-"); cx.spawn(async move |_, cx| { repo.update(cx, |repo, _| { repo.create_branch(new_branch_name.to_string()) @@ -325,6 +326,7 @@ impl PickerDelegate for BranchListDelegate { .first() .is_some_and(|entry| entry.branch.name() == query) { + let query = query.replace(' ', "-"); matches.push(BranchEntry { branch: Branch { ref_name: format!("refs/heads/{query}").into(),