Fix spurious addition hunks in files with no git repo (#24288)

Release Notes:

- N/A
This commit is contained in:
Cole Miller 2025-02-05 13:41:08 -05:00 committed by GitHub
parent 5a25751521
commit ffe503d77c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 6 deletions

View file

@ -14478,10 +14478,8 @@ fn get_uncommitted_changes_for_buffer(
let change_sets = futures::future::join_all(tasks).await; let change_sets = futures::future::join_all(tasks).await;
buffer buffer
.update(&mut cx, |buffer, cx| { .update(&mut cx, |buffer, cx| {
for change_set in change_sets { for change_set in change_sets.into_iter().flatten() {
if let Some(change_set) = change_set.log_err() { buffer.add_change_set(change_set, cx);
buffer.add_change_set(change_set, cx);
}
} }
}) })
.ok(); .ok();

View file

@ -886,7 +886,7 @@ impl Worktree {
} }
} }
} }
Ok(None) Err(anyhow!("No repository found for {path:?}"))
}) })
} }
Worktree::Remote(_) => { Worktree::Remote(_) => {
@ -910,7 +910,7 @@ impl Worktree {
} }
} }
} }
Ok(None) Err(anyhow!("No repository found for {path:?}"))
}) })
} }
Worktree::Remote(_) => Task::ready(Err(anyhow!( Worktree::Remote(_) => Task::ready(Err(anyhow!(