This is *NOT* what the change does.

We don't have a way to do the default update-only-if-existing-on-remote-side logic inside of JGit. The Transport code doesn't have a mode to do this matching, and the matching needs to happen only after the advertisement has been received from the remote side.

The change you made to push refs/heads/*:refs/heads/* would cause JGit to also create any local branch that is not yet on the remote. That is different than the behavior you describe, as the push creates new branches... :-(

I agree that fixing the code to use the remote's configuration is good, but getting that "default only if matching" rule is going to take more work in the transport package itself.