On Sun, Oct 26, 2008 at 10:31:09PM -0700, Junio C Hamano wrote: > > Of course you can say that this should be handled by git-remote itself, > > without using rename_ref() but that not seem to be a good solution to > > me. (Workaround in the wrong layer, instead of a solution in a good > > one.) > > I do not think it is a workaround at all. > > I would even say that the renaming of symref that "git remote rename" > needs to do is fundamentally different from what rename_ref() is about, > and trying to cram it into rename_ref() is a grave mistake. > > If you "git remote rename origin upstream" when origin/HEAD points at > refs/remotes/origin/master, you need to make the renamed one point at > refs/remotes/upstream/master, as you will be renaming origin/master to > upstream/master. > > Normal "rename_ref()" would just rename the ref without touching its > contents, and if you used it to implement "git remote rename", your > upstream/HEAD would point at the old name "origin/master" that will > disappear when rename is finished, wouldn't it? I do not think it is > useful. Ah, I missed that. You convienced me, I'll post updated patches later today. :)