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:
parent
78da39e19b
commit
5edded5c02
3 changed files with 365 additions and 433 deletions
|
@ -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>> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue