The original code did not take hierarchical branch names into account at all.
Tested-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
@ -317,8 +317,6 @@ static void print_ref_list(int kinds, int detached, int verbose, int abbrev)
@@ -317,8 +317,6 @@ static void print_ref_list(int kinds, int detached, int verbose, int abbrev)
static char *config_repo;
static char *config_remote;
static const char *start_ref;
static int start_len;
static int base_len;
static int get_remote_branch_name(const char *value)
{
@ -334,26 +332,41 @@ static int get_remote_branch_name(const char *value)
@@ -334,26 +332,41 @@ static int get_remote_branch_name(const char *value)
end = value + strlen(value);
/* Try an exact match first. */
/*
* Try an exact match first. I.e. handle the case where the
* value is "$anything:refs/foo/bar/baz" and start_ref is exactly
* "refs/foo/bar/baz". Then the name at the remote is $anything.