diff --git a/git-branchless-hook/src/lib.rs b/git-branchless-hook/src/lib.rs index 550202a36..26dcc5df7 100644 --- a/git-branchless-hook/src/lib.rs +++ b/git-branchless-hook/src/lib.rs @@ -456,7 +456,14 @@ fn hook_reference_transaction(effects: &Effects, transaction_state: &str) -> eyr ref_name, old_oid: _, new_oid: _, - }| !should_ignore_ref_updates(ref_name), + }| { + !should_ignore_ref_updates(ref_name) + && match CategorizedReferenceName::new(ref_name) { + CategorizedReferenceName::RemoteBranch { .. } => false, + CategorizedReferenceName::OtherRef { .. } => false, + CategorizedReferenceName::LocalBranch { .. } => true, + } + }, ) .map(|parsed_line| fix_packed_reference_oid(&repo, &packed_references, parsed_line)) .collect(); diff --git a/git-branchless-submit/tests/test_submit.rs b/git-branchless-submit/tests/test_submit.rs index ea88fc4f8..60747d5ba 100644 --- a/git-branchless-submit/tests/test_submit.rs +++ b/git-branchless-submit/tests/test_submit.rs @@ -72,8 +72,6 @@ fn test_submit() -> eyre::Result<()> { To: file:// * [new branch] bar -> bar * [new branch] qux -> qux - branchless: processing 1 update: remote branch origin/bar - branchless: processing 1 update: remote branch origin/qux "###); insta::assert_snapshot!(stdout, @r###" branchless: running command: push --set-upstream origin bar qux @@ -104,7 +102,6 @@ fn test_submit() -> eyre::Result<()> { branchless: processing 1 update: branch qux To: file:// + 20230db...bae8307 qux -> qux (forced update) - branchless: processing 1 update: remote branch origin/qux "###); insta::assert_snapshot!(stdout, @r###" branchless: running command: fetch origin refs/heads/bar refs/heads/qux @@ -281,7 +278,6 @@ fn test_submit_up_to_date_branch() -> eyre::Result<()> { branchless: processing 1 update: branch feature To: file:// * [new branch] feature -> feature - branchless: processing 1 update: remote branch origin/feature "###); insta::assert_snapshot!(stdout, @r###" branchless: running command: push --set-upstream origin feature