sha1_name: cleanup interpret_branch_name()

The 'upstream' variable doesn't hold an "upstream", but a branch, so
make it clearer.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
sha1_name: simplify track finding

It's more efficient to check for the braces first, and we already have
the length of the whole thing.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
sha1_name: add support for @{publish} marks

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>