[BUG] cogito: cg-push fails when using stg
From: Baz <hidden>
Date: 2016-06-15 22:42:48
Hi,
I've been using cogito and stg together on cairo and I ran into
problems attempting to do a cg-push.
$ cg-push
error: src refspec master matches more than one.
fatal: unexpected EOF
It turns out this is matching refs/heads/master and refs/bases/master;
the second of these is an stg artifact, but not the current branch. I
think there's a bug in cogito here, in cg-Xlib:
[ ! -s "$_git/HEAD" ] || { _git_head="$(git-symbolic-ref HEAD)";
_git_head="${_git_head#refs/heads/}"; }
This sets _git_head (which is eventually used as the src refspec for
the cg-push) to the unambiguous refs/heads/master, but then makes it
ambiguous again by stripping off the prefix.
You can work around this by doing:
cg-push -r refs/heads/master
which is just as odd, since thats a refspec, not a branch name - the
same logic to resolve the name isn't being applied. So alternatively,
the bug is here (in cg-push):
locbranch="$_git_head"
... should be
locbranch="refs/heads/$_git_head"
and
locbranch="$OPTARG"
should be
locbranch="refs/heads/$OPTARG"
Comments?
Baz