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

@ -289,8 +289,8 @@ fn parse_git_blame(output: &str) -> Result<Vec<BlameEntry>> {
}
};
if done {
if let Some(entry) = current_entry.take() {
if done
&& let Some(entry) = current_entry.take() {
index.insert(entry.sha, entries.len());
// We only want annotations that have a commit.
@ -298,7 +298,6 @@ fn parse_git_blame(output: &str) -> Result<Vec<BlameEntry>> {
entries.push(entry);
}
}
}
}
Ok(entries)

View file

@ -1447,13 +1447,11 @@ impl GitRepository for RealGitRepository {
let mut remote_branches = vec![];
let mut add_if_matching = async |remote_head: &str| {
if let Ok(merge_base) = git_cmd(&["merge-base", &head, remote_head]).await {
if merge_base.trim() == head {
if let Some(s) = remote_head.strip_prefix("refs/remotes/") {
if let Ok(merge_base) = git_cmd(&["merge-base", &head, remote_head]).await
&& merge_base.trim() == head
&& let Some(s) = remote_head.strip_prefix("refs/remotes/") {
remote_branches.push(s.to_owned().into());
}
}
}
};
// check the main branch of each remote
@ -1574,11 +1572,9 @@ impl GitRepository for RealGitRepository {
Err(error) => {
if let Some(GitBinaryCommandError { status, .. }) =
error.downcast_ref::<GitBinaryCommandError>()
{
if status.code() == Some(1) {
&& status.code() == Some(1) {
return Ok(false);
}
}
Err(error)
}