tg.sh: add fer_branch_contains utility function
Starting with Git version 2.7.0, the `git for-each-ref` command
accepts a `--contains <committish>` option.
Provide a new fer_branch_contains utility function that emulates
`git branch --contains` but using `git for-each-ref` when available
and otherwise falling back to the old `git branch --no-color --contains`
technique that parses and munges the `git branch --contains` output.
The fer_branch_contains function provides the foundation for switching
away from parsing the output of `git branch --contains` since there's
no guarantee that its output will not change in the future whereas
by using `git for-each-ref` with an explicit `--format=%(refname)`
option the output format is guaranteed to remain consistent.
Since the output of `git branch --contains` for versions prior to
Git 2.7.0 will not be changing at this point and that output is
fully parseable, using fer_branch_contains provides future proofing.
Signed-off-by: Kyle J. McKay <mackyle@gmail.com>