mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-22 17:11:43 +03:00
fetch after push
This commit is contained in:
parent
488f7862f5
commit
d95cbdb738
@ -1508,6 +1508,7 @@ pub fn push(
|
||||
branch_writer
|
||||
.write(&vbranch)
|
||||
.context("failed to write target branch after push")?;
|
||||
fetch(project_path).context("failed to fetch after push")?;
|
||||
Ok(())
|
||||
} else {
|
||||
Err(anyhow::anyhow!(
|
||||
@ -1517,6 +1518,24 @@ pub fn push(
|
||||
}
|
||||
}
|
||||
|
||||
fn fetch(project_path: &str) -> Result<()> {
|
||||
let output = Command::new("git")
|
||||
.arg("fetch")
|
||||
.arg("origin")
|
||||
.current_dir(project_path)
|
||||
.output()
|
||||
.context("failed to fork exec")?;
|
||||
|
||||
if output.status.success() {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(anyhow::anyhow!(
|
||||
"failed to fetch: {}",
|
||||
String::from_utf8(output.stderr)?
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use tempfile::tempdir;
|
||||
|
Loading…
Reference in New Issue
Block a user