tg-{contains,info}.sh: adopt fer_branch_contains
commit001ad15bb155121de865f9649ea2dd2d4e28ba9a
authorKyle J. McKay <mackyle@gmail.com>
Tue, 24 Aug 2021 15:34:44 +0000 (24 08:34 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Tue, 24 Aug 2021 15:34:44 +0000 (24 08:34 -0700)
treeec291533eb4fe9d708a3798add9cfaba984db53c
parent80b84a68fbf2d2c0be506f93ff0c201ea37cd6d4
tg-{contains,info}.sh: adopt fer_branch_contains

Switch away from calling `git branch --no-color --contains` directly
and instead us the new fer_branch_contains function.

By doing this `git for-each-ref --contains` will automatically be
used when running Git prior to v2.7.0 but automatically emulated
using the old parse-branch-contains-no-color-output technique.

In addition, since the new fer_branch_contains function always
provides full ref names (even in emulation mode) any possible
ambiguity between refs/heads and refs/remotes names evaporates.

Furthermore, use of fer_branch_contains insulates the code from any
capricous change to the `git branch --no-color --contains` output
format in the future.

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