tg-revert.sh: keep matching tags when reverting
commit475c45a2fbcb1c71a74e9c0974e3aebe968c2c2c
authorKyle J. McKay <mackyle@gmail.com>
Wed, 14 Mar 2018 08:28:50 +0000 (14 01:28 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Wed, 14 Mar 2018 08:28:50 +0000 (14 01:28 -0700)
tree08f129d33807663b43329424fe2dd4eaf25226dd
parent0a928d2543395e31f43e6a2fb31971b4d9125a9c
tg-revert.sh: keep matching tags when reverting

When `tg tag` stores refs it only ever stores ref names that point
to commits.

If `tg tag` has been told to store an annotated/signed tag that
points to a commit, it will emit a warning and store it as a
lightweight tag instead (i.e. dereference it to the commit and store
that).

When reverting, if the ref being reverted actually refers to a `tag`
object that dereferences to the same commit object which would be
restored, then leave that ref alone.

The effect will be essentially the same -- that ref when used as a
committish will still produce the same commit object, but this way
tag objects do not needlessly get downgraded.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
tg-revert.sh