interpret_branch_name: factor out upstream handling

This function checks a few different @{}-constructs. The
early part checks for and dispatches us to helpers for each
construct, but the code for handling @{upstream} is inline.

Let's factor this out into its own function. This makes
interpret_branch_name more readable, and will make it much
simpler to add more constructs in future patches.

While we're at it, let's also break apart the refactored
code into a few helper functions. These will be useful when
we implement similar @{upstream}-like constructs.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
remote: introduce and fill branch->pushremote

When a caller uses branch_get to retrieve a "struct branch", they get
the per-branch remote name and a pointer to the remote struct. However,
they have no way of knowing about the per-branch pushremote from this
interface.

Let's expose that information via fields similar to "remote" and
"remote_name".

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
t1507 (rev-parse-upstream): fix typo in test title

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
sha1_name: prepare for publish_mark()

Corresponding to upstream_mark(), write a publish_mark().

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
sha1_name: implement get_publish_branch()

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>