Update GREB_HEAD before pulling

If detached, it stores the commit in GREB_HEAD.
If not detached, it stores the full symbolic name of the branch in
GREB_HEAD.

Work internally with full names of branches. Remove asumption that the
abbreviated symbolic full name of 'refs/heads/<name>' is always
'<name>'.