diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-12-28 11:32:36 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-12-28 11:32:36 -0800 |
commit | 7a5638a1597da222dde484074392223d8daebd15 (patch) | |
tree | 66221490fd990d15dbbf3f19b9095004e025ff04 /builtin | |
parent | 2cb1ff9ac35ff043e377f78e36a57422a6846485 (diff) | |
parent | bab8d28e774c255a326ad5592af6351e4925efcb (diff) | |
download | git-7a5638a1597da222dde484074392223d8daebd15.tar.gz git-7a5638a1597da222dde484074392223d8daebd15.tar.xz |
Merge branch 'jk/fetch-no-tail-match-refs' into maint
* jk/fetch-no-tail-match-refs:
connect.c: drop path_match function
fetch-pack: match refs exactly
t5500: give fully-qualified refs to fetch-pack
drop "match" parameter from get_remote_heads
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/fetch-pack.c | 15 | ||||
-rw-r--r-- | builtin/send-pack.c | 3 |
2 files changed, 11 insertions, 7 deletions
diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c index c6bc8eb0a..6207ecd29 100644 --- a/builtin/fetch-pack.c +++ b/builtin/fetch-pack.c @@ -556,11 +556,16 @@ static void filter_refs(struct ref **refs, int nr_match, char **match) continue; } else { - int order = path_match(ref->name, nr_match, match); - if (order) { - return_refs[order-1] = ref; - continue; /* we will link it later */ + int i; + for (i = 0; i < nr_match; i++) { + if (!strcmp(ref->name, match[i])) { + match[i][0] = '\0'; + return_refs[i] = ref; + break; + } } + if (i < nr_match) + continue; /* we will link it later */ } free(ref); } @@ -976,7 +981,7 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix) args.verbose ? CONNECT_VERBOSE : 0); } - get_remote_heads(fd[0], &ref, 0, NULL, 0, NULL); + get_remote_heads(fd[0], &ref, 0, NULL); ref = fetch_pack(&args, fd, conn, ref, dest, nr_heads, heads, pack_lockfile_ptr); diff --git a/builtin/send-pack.c b/builtin/send-pack.c index e0b8030f2..cd1115ffc 100644 --- a/builtin/send-pack.c +++ b/builtin/send-pack.c @@ -494,8 +494,7 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix) memset(&extra_have, 0, sizeof(extra_have)); - get_remote_heads(fd[0], &remote_refs, 0, NULL, REF_NORMAL, - &extra_have); + get_remote_heads(fd[0], &remote_refs, REF_NORMAL, &extra_have); transport_verify_remote_names(nr_refspecs, refspecs); |