diff --git a/zk_toolbox/crates/common/src/git.rs b/zk_toolbox/crates/common/src/git.rs index 9db21daed361..ea6540c20b29 100644 --- a/zk_toolbox/crates/common/src/git.rs +++ b/zk_toolbox/crates/common/src/git.rs @@ -32,6 +32,9 @@ pub fn submodule_update(shell: &Shell, link_to_code: PathBuf) -> anyhow::Result< pub fn pull(shell: &Shell, link_to_code: PathBuf) -> anyhow::Result<()> { let _dir_guard = shell.push_dir(link_to_code); - Cmd::new(cmd!(shell, "git pull")).run()?; + let res = Cmd::new(cmd!(shell, "git rev-parse --abbrev-ref HEAD")).run_with_output()?; + let current_branch = String::from_utf8(res.stdout)?; + let current_branch = current_branch.trim_end(); + Cmd::new(cmd!(shell, "git pull origin {current_branch}")).run()?; Ok(()) }