Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
fetch: convert do_fetch to take a struct refspec
author
Brandon Williams
<bmwill@google.com>
Wed, 16 May 2018 22:58:07 +0000
(15:58 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 17 May 2018 21:19:43 +0000
(06:19 +0900)
Convert 'do_fetch()' 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>
builtin/fetch.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
860fdf1
)
diff --git
a/builtin/fetch.c
b/builtin/fetch.c
index 6b909cd5bf2524301ccf919a0de073bee6cd4dab..ec54b1dfe147ce672d5ad18183179f02dac21726 100644
(file)
--- a/
builtin/fetch.c
+++ b/
builtin/fetch.c
@@
-1112,7
+1112,7
@@
static void backfill_tags(struct transport *transport, struct ref *ref_map)
}
static int do_fetch(struct transport *transport,
}
static int do_fetch(struct transport *transport,
- struct refspec
_item *refs, int ref_count
)
+ struct refspec
*rs
)
{
struct string_list existing_refs = STRING_LIST_INIT_DUP;
struct ref *ref_map;
{
struct string_list existing_refs = STRING_LIST_INIT_DUP;
struct ref *ref_map;
@@
-1136,7
+1136,7
@@
static int do_fetch(struct transport *transport,
goto cleanup;
}
goto cleanup;
}
- ref_map = get_ref_map(transport, r
efs, ref_count
, tags, &autotags);
+ ref_map = get_ref_map(transport, r
s->items, rs->nr
, tags, &autotags);
if (!update_head_ok)
check_not_current_branch(ref_map);
if (!update_head_ok)
check_not_current_branch(ref_map);
@@
-1160,8
+1160,8
@@
static int do_fetch(struct transport *transport,
* explicitly (via command line or configuration); we
* don't care whether --tags was specified.
*/
* explicitly (via command line or configuration); we
* don't care whether --tags was specified.
*/
- if (r
ef_count
) {
- prune_refs(r
efs, ref_count
, ref_map, transport->url);
+ if (r
s->nr
) {
+ prune_refs(r
s->items, rs->nr
, ref_map, transport->url);
} else {
prune_refs(transport->remote->fetch.items,
transport->remote->fetch.nr,
} else {
prune_refs(transport->remote->fetch.items,
transport->remote->fetch.nr,
@@
-1410,7
+1410,7
@@
static int fetch_one(struct remote *remote, int argc, const char **argv, int pru
sigchain_push_common(unlock_pack_on_signal);
atexit(unlock_pack);
sigchain_push_common(unlock_pack_on_signal);
atexit(unlock_pack);
- exit_code = do_fetch(gtransport,
rs.items, rs.nr
);
+ exit_code = do_fetch(gtransport,
&rs
);
refspec_clear(&rs);
transport_disconnect(gtransport);
gtransport = NULL;
refspec_clear(&rs);
transport_disconnect(gtransport);
gtransport = NULL;