tg: disambiguate refs/heads/refs/remotes/<name>/<branch>
commitd7125044b6571c606830c28abf583fdfb15a47f7
authorKyle J. McKay <mackyle@gmail.com>
Tue, 20 Jun 2017 20:16:58 +0000 (20 13:16 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Tue, 20 Jun 2017 20:16:58 +0000 (20 13:16 -0700)
tree241e4ee4263f1f345f5a81cfc1a30e1bfe9c1cfe
parent8e187f798f90f9f6dd971c877faedb1b37d0c60b
tg: disambiguate refs/heads/refs/remotes/<name>/<branch>

When recursing for updates and out-of-date checks, remotes are
handled (when present) by outputting a full ref name.

However, if a refs-namespace-like branch name should be used
(e.g. refs/heads/refs/remote/origin/master) it could be
misinterpreted as being a remote instead of a branch.

Fix this by prefixing a ":" to any full ref names.  Since
":" is not a valid ref name character (and an isolated ":"
is already being used by branch_needs_update), this succeeds
in disambiguating the two cases with practically no impact.

There's no conflict with the pre-existing branch_needs_update
usage since the new usage will never produce an isolated ":".

Some code has even become simplified as a result (and in fact
this update removes more lines than it adds).

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
t/t4200-out-of-date.sh
tg-export.sh
tg-info.sh
tg-update.sh
tg.sh