tg-export.sh: validate and accept multiple -b options
commit16f80e102a9da3f51a39383f294981d605fdfee8
authorKyle J. McKay <mackyle@gmail.com>
Wed, 14 Dec 2016 00:20:33 +0000 (13 16:20 -0800)
committerKyle J. McKay <mackyle@gmail.com>
Wed, 14 Dec 2016 00:20:33 +0000 (13 16:20 -0800)
tree86998ac75f6fab25897b1ac35c45f2977611166c
parent0990ffdf066036e535e8d0b9b7d21f6c4a145856
tg-export.sh: validate and accept multiple -b options

From the description it's unclear how multiple branches are
to be specified.

Previously the code accepted ',' separated branch names, but
only one "-b" option (subsequent "-b" values replaced any previous
"-b" values).

However, "," is a valid character in a Git branch name.

Therefore, correct this by only allowing " " separators, but also
allowing multiple "-b" options each of which may contain zero or
more space-separated branch names.

Finally, validate the given branch names because only TopGit branch
names are actually accepted.  This also has the side benefit that
using the name HEAD to refer to the branch a symbolic-ref HEAD points
to just automatically starts working now.

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