Johannes Schindelin <Johannes.Schindelin@xxxxxx> writes: >> > - if (!copy && rename_ref(oldref.buf, newref.buf, logmsg.buf)) >> > + if (!copy && (oldname != head || !is_null_oid(&head_oid)) && >> >> It always makes readers uneasy to see pointer comparison of two >> strings. > > Even if it was on purpose ;-) FWIW, for fun I dropped "oldname != head ||" and tried to run the whole testsuite (plus the "branch -m src dst" form test I gave earlier), and it almost passed all of them except one, which was surprising. > + if (!copy && !is_unborn_branch(oldname, oldref.buf) && > rename_ref(oldref.buf, newref.buf, logmsg.buf)) Yeah, a helper function makes it much more clear what is going on. > Having said that, I fixed the `git branch -m <current-unborn> <new-name>` > use case; the fix will be part of v3. ;-)