branch.c: use ref transaction for all ref updates