Merge branch 'jc/match-refs-clarify'

* jc/match-refs-clarify:
  rename "match_refs()" to "match_push_refs()"
  send-pack: typofix error message
maint
Junio C Hamano 2011-10-21 16:04:35 -07:00
commit 470bbbc4dc
6 changed files with 18 additions and 15 deletions

View File

@ -389,7 +389,7 @@ static int get_push_ref_states(const struct ref *remote_refs,
local_refs = get_local_heads(); local_refs = get_local_heads();
push_map = copy_ref_list(remote_refs); push_map = copy_ref_list(remote_refs);


match_refs(local_refs, &push_map, remote->push_refspec_nr, match_push_refs(local_refs, &push_map, remote->push_refspec_nr,
remote->push_refspec, MATCH_REFS_NONE); remote->push_refspec, MATCH_REFS_NONE);


states->push.strdup_strings = 1; states->push.strdup_strings = 1;

View File

@ -334,7 +334,7 @@ int send_pack(struct send_pack_args *args,
demux.data = fd; demux.data = fd;
demux.out = -1; demux.out = -1;
if (start_async(&demux)) if (start_async(&demux))
die("receive-pack: unable to fork off sideband demultiplexer"); die("send-pack: unable to fork off sideband demultiplexer");
in = demux.out; in = demux.out;
} }


@ -509,7 +509,7 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)
flags |= MATCH_REFS_MIRROR; flags |= MATCH_REFS_MIRROR;


/* match them up */ /* match them up */
if (match_refs(local_refs, &remote_refs, nr_refspecs, refspecs, flags)) if (match_push_refs(local_refs, &remote_refs, nr_refspecs, refspecs, flags))
return -1; return -1;


set_ref_status_for_push(remote_refs, args.send_mirror, set_ref_status_for_push(remote_refs, args.send_mirror,

View File

@ -1869,7 +1869,7 @@ int main(int argc, char **argv)
} }


/* match them up */ /* match them up */
if (match_refs(local_refs, &remote_refs, if (match_push_refs(local_refs, &remote_refs,
nr_refspec, (const char **) refspec, push_all)) { nr_refspec, (const char **) refspec, push_all)) {
rc = -1; rc = -1;
goto cleanup; goto cleanup;

View File

@ -1145,11 +1145,14 @@ static struct ref **tail_ref(struct ref **head)
} }


/* /*
* Note. This is used only by "push"; refspec matching rules for * Given the set of refs the local repository has, the set of refs the
* push and fetch are subtly different, so do not try to reuse it * remote repository has, and the refspec used for push, determine
* without thinking. * what remote refs we will update and with what value by setting
* peer_ref (which object is being pushed) and force (if the push is
* forced) in elements of "dst". The function may add new elements to
* dst (e.g. pushing to a new branch, done in match_explicit_refs).
*/ */
int match_refs(struct ref *src, struct ref **dst, int match_push_refs(struct ref *src, struct ref **dst,
int nr_refspec, const char **refspec, int flags) int nr_refspec, const char **refspec, int flags)
{ {
struct refspec *rs; struct refspec *rs;

View File

@ -96,7 +96,7 @@ void free_refspec(int nr_refspec, struct refspec *refspec);
char *apply_refspecs(struct refspec *refspecs, int nr_refspec, char *apply_refspecs(struct refspec *refspecs, int nr_refspec,
const char *name); const char *name);


int match_refs(struct ref *src, struct ref **dst, int match_push_refs(struct ref *src, struct ref **dst,
int nr_refspec, const char **refspec, int all); int nr_refspec, const char **refspec, int all);
void set_ref_status_for_push(struct ref *remote_refs, int send_mirror, void set_ref_status_for_push(struct ref *remote_refs, int send_mirror,
int force_update); int force_update);

View File

@ -1026,7 +1026,7 @@ int transport_push(struct transport *transport,
if (flags & TRANSPORT_PUSH_MIRROR) if (flags & TRANSPORT_PUSH_MIRROR)
match_flags |= MATCH_REFS_MIRROR; match_flags |= MATCH_REFS_MIRROR;


if (match_refs(local_refs, &remote_refs, if (match_push_refs(local_refs, &remote_refs,
refspec_nr, refspec, match_flags)) { refspec_nr, refspec, match_flags)) {
return -1; return -1;
} }