From f4a6732d3592a2e483bb733f80f0c484c9b4ea74 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Sun, 10 Jan 2021 23:23:40 -0800 Subject: [PATCH] git: import refs after pushing to git remote This makes it so `jj git push` effectively runs `jj git refresh` after pushing. That's useful so the user sees the updated remote-tracking branch. --- src/commands.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/commands.rs b/src/commands.rs index e1d2d1d26..c80b52ffc 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -2080,6 +2080,9 @@ fn cmd_git_push( let branch_name = cmd_matches.value_of("branch").unwrap(); git::push_commit(&git_repo, &commit, remote_name, branch_name) .map_err(|err| CommandError::UserError(err.to_string()))?; + let mut tx = repo.start_transaction("import git refs"); + git::import_refs(&mut tx, &git_repo).map_err(|err| CommandError::UserError(err.to_string()))?; + tx.commit(); Ok(()) }