Merge branch 'jc/push-refmap'
Make "git push origin master" update the same ref that would be updated by our 'master' when "git push origin" (no refspecs) is run while the 'master' branch is checked out, which makes "git push" more symmetric to "git fetch" and more usable for the triangular workflow. * jc/push-refmap: push: also use "upstream" mapping when pushing a single ref push: use remote.$name.push as a refmap builtin/push.c: use strbuf instead of manual allocation
This commit is contained in:
8
remote.c
8
remote.c
@ -852,7 +852,7 @@ static int match_name_with_pattern(const char *key, const char *name,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int query_refspecs(struct refspec *refs, int ref_count, struct refspec *query)
|
||||
int query_refspecs(struct refspec *refs, int ref_count, struct refspec *query)
|
||||
{
|
||||
int i;
|
||||
int find_src = !query->src;
|
||||
@ -986,9 +986,9 @@ void sort_ref_list(struct ref **l, int (*cmp)(const void *, const void *))
|
||||
*l = llist_mergesort(*l, ref_list_get_next, ref_list_set_next, cmp);
|
||||
}
|
||||
|
||||
static int count_refspec_match(const char *pattern,
|
||||
struct ref *refs,
|
||||
struct ref **matched_ref)
|
||||
int count_refspec_match(const char *pattern,
|
||||
struct ref *refs,
|
||||
struct ref **matched_ref)
|
||||
{
|
||||
int patlen = strlen(pattern);
|
||||
struct ref *matched_weak = NULL;
|
||||
|
Reference in New Issue
Block a user