File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ static struct string_list push_options_config = STRING_LIST_INIT_DUP;
64
64
static const char * map_refspec (const char * ref ,
65
65
struct remote * remote , struct ref * local_refs )
66
66
{
67
+ const char * branch_name ;
67
68
struct ref * matched = NULL ;
68
69
69
70
/* Does "ref" uniquely name our ref? */
@@ -84,8 +85,8 @@ static const char *map_refspec(const char *ref,
84
85
}
85
86
86
87
if (push_default == PUSH_DEFAULT_UPSTREAM &&
87
- starts_with (matched -> name , "refs/heads/" )) {
88
- struct branch * branch = branch_get (matched -> name + 11 );
88
+ skip_prefix (matched -> name , "refs/heads/" , & branch_name )) {
89
+ struct branch * branch = branch_get (branch_name );
89
90
if (branch -> merge_nr == 1 && branch -> merge [0 ]-> src ) {
90
91
struct strbuf buf = STRBUF_INIT ;
91
92
strbuf_addf (& buf , "%s:%s" ,
You can’t perform that action at this time.
0 commit comments