Simplify project git code (#25662)

This was originally a part of another PR, but I wanted to get the
refactoring in and shift focus to working on bugs.

This causes all git commands via the `Repository` entity to be
serialized, and allows us to return values other than `Result<()>`

Release Notes:

- N/A
This commit is contained in:
Mikayla Maki 2025-02-26 10:16:10 -08:00 committed by GitHub
parent 78da39e19b
commit 5edded5c02
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 365 additions and 433 deletions

View file

@ -618,10 +618,9 @@ impl GitRepository for RealGitRepository {
"Failed to push:\n{}",
String::from_utf8_lossy(&output.stderr)
));
} else {
Ok(())
}
// TODO: Get remote response out of this and show it to the user
Ok(())
}
fn pull(&self, branch_name: &str, remote_name: &str) -> Result<()> {
@ -639,10 +638,9 @@ impl GitRepository for RealGitRepository {
"Failed to pull:\n{}",
String::from_utf8_lossy(&output.stderr)
));
} else {
return Ok(());
}
// TODO: Get remote response out of this and show it to the user
Ok(())
}
fn fetch(&self) -> Result<()> {
@ -658,10 +656,9 @@ impl GitRepository for RealGitRepository {
"Failed to fetch:\n{}",
String::from_utf8_lossy(&output.stderr)
));
} else {
return Ok(());
}
// TODO: Get remote response out of this and show it to the user
Ok(())
}
fn get_remotes(&self, branch_name: Option<&str>) -> Result<Vec<Remote>> {