First pass on fixes

This commit is contained in:
Piotr Osiewicz 2025-08-19 14:23:59 +02:00
parent 5826d89b97
commit 2f3be75fc7
269 changed files with 1593 additions and 2574 deletions

View file

@ -135,12 +135,10 @@ impl CommitModal {
.as_ref()
.and_then(|repo| repo.read(cx).head_commit.as_ref())
.is_some()
{
if !git_panel.amend_pending() {
&& !git_panel.amend_pending() {
git_panel.set_amend_pending(true, cx);
git_panel.load_last_commit_message_if_empty(cx);
}
}
}
ForceMode::Commit => {
if git_panel.amend_pending() {
@ -195,13 +193,12 @@ impl CommitModal {
let commit_message = commit_editor.read(cx).text(cx);
if let Some(suggested_commit_message) = suggested_commit_message {
if commit_message.is_empty() {
if let Some(suggested_commit_message) = suggested_commit_message
&& commit_message.is_empty() {
commit_editor.update(cx, |editor, cx| {
editor.set_placeholder_text(suggested_commit_message, cx);
});
}
}
let focus_handle = commit_editor.focus_handle(cx);

View file

@ -926,9 +926,9 @@ impl GitPanel {
let workspace = self.workspace.upgrade()?;
let git_repo = self.active_repository.as_ref()?;
if let Some(project_diff) = workspace.read(cx).active_item_as::<ProjectDiff>(cx) {
if let Some(project_path) = project_diff.read(cx).active_path(cx) {
if Some(&entry.repo_path)
if let Some(project_diff) = workspace.read(cx).active_item_as::<ProjectDiff>(cx)
&& let Some(project_path) = project_diff.read(cx).active_path(cx)
&& Some(&entry.repo_path)
== git_repo
.read(cx)
.project_path_to_repo_path(&project_path, cx)
@ -937,9 +937,7 @@ impl GitPanel {
project_diff.focus_handle(cx).focus(window);
project_diff.update(cx, |project_diff, cx| project_diff.autoscroll(cx));
return None;
}
}
};
};
self.workspace
.update(cx, |workspace, cx| {
@ -2514,11 +2512,10 @@ impl GitPanel {
new_co_authors.push((name.clone(), email.clone()))
}
}
if !project.is_local() && !project.is_read_only(cx) {
if let Some(local_committer) = self.local_committer(room, cx) {
if !project.is_local() && !project.is_read_only(cx)
&& let Some(local_committer) = self.local_committer(room, cx) {
new_co_authors.push(local_committer);
}
}
new_co_authors
}
@ -2758,15 +2755,14 @@ impl GitPanel {
pending_staged_count += pending.entries.len();
last_pending_staged = pending.entries.first().cloned();
}
if let Some(single_staged) = &single_staged_entry {
if pending
if let Some(single_staged) = &single_staged_entry
&& pending
.entries
.iter()
.any(|entry| entry.repo_path == single_staged.repo_path)
{
pending_status_for_single_staged = Some(pending.target_status);
}
}
}
if conflict_entries.len() == 0 && staged_count == 1 && pending_staged_count == 0 {

View file

@ -363,11 +363,10 @@ impl ProjectDiff {
}
_ => {}
}
if editor.focus_handle(cx).contains_focused(window, cx) {
if self.multibuffer.read(cx).is_empty() {
if editor.focus_handle(cx).contains_focused(window, cx)
&& self.multibuffer.read(cx).is_empty() {
self.focus_handle.focus(window)
}
}
}
fn load_buffers(&mut self, cx: &mut Context<Self>) -> Vec<Task<Result<DiffBuffer>>> {