sha1_name: refactor interpret_upstream_mark
commit48c58471c2d4d7293272448a18801cd27555f6b5
authorJeff King <peff@peff.net>
Thu, 21 May 2015 04:45:43 +0000 (21 00:45 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 22 May 2015 16:33:08 +0000 (22 09:33 -0700)
treee892529cc4aa57b414a643aa2062bac0fa476707
parenta1ad0eb0cb1c9c83492b17d7a218be084466bf9a
sha1_name: refactor interpret_upstream_mark

Now that most of the logic for our local get_upstream_branch
has been pushed into the generic branch_get_upstream, we can
fold the remainder into interpret_upstream_mark.

Furthermore, what remains is generic to any branch-related
"@{foo}" we might add in the future, and there's enough
boilerplate that we'd like to reuse it. Let's parameterize
the two operations (parsing the mark and computing its
value) so that we can reuse this for "@{push}" in the near
future.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1_name.c