diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2012-09-09 08:19:49 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-09-12 11:46:32 -0700 |
commit | 5f0fc64513c8cb638e0d6010005d8e86c9dbca3a (patch) | |
tree | 9af38ff8d62999de23aab18eb9b08446294a0e95 /builtin | |
parent | b285668dd23952b96d716aac769c0ed1080d11d3 (diff) | |
download | git-5f0fc64513c8cb638e0d6010005d8e86c9dbca3a.tar.gz |
fetch-pack: eliminate spurious error messages
It used to be that if "--all", "--depth", and also explicit references
were sought, then the explicit references were not handled correctly
in filter_refs() because the "--all --depth" code took precedence over
the explicit reference handling, and the explicit references were
never noted as having been found. So check for explicitly sought
references before proceeding to the "--all --depth" logic.
This fixes two test cases in t5500.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/fetch-pack.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c index 42078e5cd5..e6443986b8 100644 --- a/builtin/fetch-pack.c +++ b/builtin/fetch-pack.c @@ -549,9 +549,6 @@ static void filter_refs(struct ref **refs, struct string_list *sought) if (!memcmp(ref->name, "refs/", 5) && check_refname_format(ref->name + 5, 0)) ; /* trash */ - else if (args.fetch_all && - (!args.depth || prefixcmp(ref->name, "refs/tags/"))) - keep = 1; else { while (sought_pos < sought->nr) { int cmp = strcmp(ref->name, sought->items[sought_pos].string); @@ -567,6 +564,10 @@ static void filter_refs(struct ref **refs, struct string_list *sought) } } + if (! keep && args.fetch_all && + (!args.depth || prefixcmp(ref->name, "refs/tags/"))) + keep = 1; + if (keep) { *newtail = ref; ref->next = NULL; @@ -576,8 +577,7 @@ static void filter_refs(struct ref **refs, struct string_list *sought) } } - if (!args.fetch_all) - filter_string_list(sought, 0, non_matching_ref, NULL); + filter_string_list(sought, 0, non_matching_ref, NULL); *refs = newlist; } |