Hi,
I have realized that it was overcomplicated and against the
common practice of having .git/HEAD pointing to the current
branch, as I've just seen on a git-switch-branch by Jeff.
But the only thing I miss now is the origin handling.
Sorry for the noise.
Santi