Make SetDefaultBranch transactional
SetDefaultBranch sets HEAD to a reference using git-symbolic-ref. However, git-symbolic-ref does not call the reference-transaction hook so we have no way of voting.
Add a method SetDefaultBranchWithTransaction that instead of calling git-symbolic-ref, does its own operation using a safe locking file writer which supports transaction voting.
fixes: #4044 (closed)
Edited by John Cai