Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2018-05-17 01:58:09 +0300
committerJunio C Hamano <gitster@pobox.com>2018-05-18 00:19:43 +0300
commitdef11e71932a908bf9e1339f05235d9ba39a2774 (patch)
tree9b1bbdb58bc4d1be36955fba4533eaf3ba349a00 /builtin/fetch.c
parent65d96c8b7dd78aad623d833c2c8dec625b8e00b6 (diff)
fetch: convert prune_refs to take a struct refspec
Convert 'prune_refs()' to take a 'struct refspec' as a parameter instead of a list of 'struct refspec_item'. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/fetch.c')
-rw-r--r--builtin/fetch.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 836eb7545c..5e46df70cc 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -959,11 +959,11 @@ static int fetch_refs(struct transport *transport, struct ref *ref_map)
return ret;
}
-static int prune_refs(struct refspec_item *refs, int ref_count, struct ref *ref_map,
- const char *raw_url)
+static int prune_refs(struct refspec *rs, struct ref *ref_map,
+ const char *raw_url)
{
int url_len, i, result = 0;
- struct ref *ref, *stale_refs = get_stale_heads(refs, ref_count, ref_map);
+ struct ref *ref, *stale_refs = get_stale_heads(rs->items, rs->nr, ref_map);
char *url;
int summary_width = transport_summary_width(stale_refs);
const char *dangling_msg = dry_run
@@ -1158,10 +1158,9 @@ static int do_fetch(struct transport *transport,
* don't care whether --tags was specified.
*/
if (rs->nr) {
- prune_refs(rs->items, rs->nr, ref_map, transport->url);
+ prune_refs(rs, ref_map, transport->url);
} else {
- prune_refs(transport->remote->fetch.items,
- transport->remote->fetch.nr,
+ prune_refs(&transport->remote->fetch,
ref_map,
transport->url);
}