Skip to content

Commit 65a1301

Browse files
bmwillgitster
authored andcommitted
fetch: convert do_fetch to take a struct refspec
Convert 'do_fetch()' to take a 'struct refspec' as a parameter instead of a list of 'struct refspec_item'. Signed-off-by: Brandon Williams <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 860fdf1 commit 65a1301

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

builtin/fetch.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ static void backfill_tags(struct transport *transport, struct ref *ref_map)
11121112
}
11131113

11141114
static int do_fetch(struct transport *transport,
1115-
struct refspec_item *refs, int ref_count)
1115+
struct refspec *rs)
11161116
{
11171117
struct string_list existing_refs = STRING_LIST_INIT_DUP;
11181118
struct ref *ref_map;
@@ -1136,7 +1136,7 @@ static int do_fetch(struct transport *transport,
11361136
goto cleanup;
11371137
}
11381138

1139-
ref_map = get_ref_map(transport, refs, ref_count, tags, &autotags);
1139+
ref_map = get_ref_map(transport, rs->items, rs->nr, tags, &autotags);
11401140
if (!update_head_ok)
11411141
check_not_current_branch(ref_map);
11421142

@@ -1160,8 +1160,8 @@ static int do_fetch(struct transport *transport,
11601160
* explicitly (via command line or configuration); we
11611161
* don't care whether --tags was specified.
11621162
*/
1163-
if (ref_count) {
1164-
prune_refs(refs, ref_count, ref_map, transport->url);
1163+
if (rs->nr) {
1164+
prune_refs(rs->items, rs->nr, ref_map, transport->url);
11651165
} else {
11661166
prune_refs(transport->remote->fetch.items,
11671167
transport->remote->fetch.nr,
@@ -1410,7 +1410,7 @@ static int fetch_one(struct remote *remote, int argc, const char **argv, int pru
14101410

14111411
sigchain_push_common(unlock_pack_on_signal);
14121412
atexit(unlock_pack);
1413-
exit_code = do_fetch(gtransport, rs.items, rs.nr);
1413+
exit_code = do_fetch(gtransport, &rs);
14141414
refspec_clear(&rs);
14151415
transport_disconnect(gtransport);
14161416
gtransport = NULL;

0 commit comments

Comments
 (0)