summaryrefslogtreecommitdiff
path: root/submodule.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-05-30 12:51:26 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-30 12:51:26 (GMT)
commite12cbeaa624b82bc00d585bb24c8034fbf5f9de2 (patch)
tree6eed9588af71c6ba9776f592c3573d88929d1bab /submodule.c
parent6ac5acae2d93f49f169d9b10dd9fcbce3fd874e2 (diff)
parentdcc73cf7ffd17e68bda05fff4c139465580aff28 (diff)
downloadgit-e12cbeaa624b82bc00d585bb24c8034fbf5f9de2.zip
git-e12cbeaa624b82bc00d585bb24c8034fbf5f9de2.tar.gz
git-e12cbeaa624b82bc00d585bb24c8034fbf5f9de2.tar.bz2
Merge branch 'bw/ref-prefix-for-configured-refspec'
"git fetch $there $refspec" that talks over protocol v2 can take advantage of server-side ref filtering; the code has been extended so that this mechanism triggers also when fetching with configured refspec. * bw/ref-prefix-for-configured-refspec: (38 commits) fetch: generate ref-prefixes when using a configured refspec refspec: consolidate ref-prefix generation logic submodule: convert push_unpushed_submodules to take a struct refspec remote: convert check_push_refs to take a struct refspec remote: convert match_push_refs to take a struct refspec http-push: store refspecs in a struct refspec transport: remove transport_verify_remote_names send-pack: store refspecs in a struct refspec transport: convert transport_push to take a struct refspec push: convert to use struct refspec push: check for errors earlier remote: convert match_explicit_refs to take a struct refspec remote: convert get_ref_match to take a struct refspec remote: convert query_refspecs to take a struct refspec remote: convert apply_refspecs to take a struct refspec remote: convert get_stale_heads to take a struct refspec fetch: convert prune_refs to take a struct refspec fetch: convert get_ref_map to take a struct refspec fetch: convert do_fetch to take a struct refspec refspec: remove the deprecated functions ...
Diffstat (limited to 'submodule.c')
-rw-r--r--submodule.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/submodule.c b/submodule.c
index 1f88623..47d0057 100644
--- a/submodule.c
+++ b/submodule.c
@@ -968,7 +968,7 @@ int find_unpushed_submodules(struct oid_array *commits,
static int push_submodule(const char *path,
const struct remote *remote,
- const char **refspec, int refspec_nr,
+ const struct refspec *rs,
const struct string_list *push_options,
int dry_run)
{
@@ -991,8 +991,8 @@ static int push_submodule(const char *path,
if (remote->origin != REMOTE_UNCONFIGURED) {
int i;
argv_array_push(&cp.args, remote->name);
- for (i = 0; i < refspec_nr; i++)
- argv_array_push(&cp.args, refspec[i]);
+ for (i = 0; i < rs->raw_nr; i++)
+ argv_array_push(&cp.args, rs->raw[i]);
}
prepare_submodule_repo_env(&cp.env_array);
@@ -1013,7 +1013,7 @@ static int push_submodule(const char *path,
*/
static void submodule_push_check(const char *path, const char *head,
const struct remote *remote,
- const char **refspec, int refspec_nr)
+ const struct refspec *rs)
{
struct child_process cp = CHILD_PROCESS_INIT;
int i;
@@ -1023,8 +1023,8 @@ static void submodule_push_check(const char *path, const char *head,
argv_array_push(&cp.args, head);
argv_array_push(&cp.args, remote->name);
- for (i = 0; i < refspec_nr; i++)
- argv_array_push(&cp.args, refspec[i]);
+ for (i = 0; i < rs->raw_nr; i++)
+ argv_array_push(&cp.args, rs->raw[i]);
prepare_submodule_repo_env(&cp.env_array);
cp.git_cmd = 1;
@@ -1043,7 +1043,7 @@ static void submodule_push_check(const char *path, const char *head,
int push_unpushed_submodules(struct oid_array *commits,
const struct remote *remote,
- const char **refspec, int refspec_nr,
+ const struct refspec *rs,
const struct string_list *push_options,
int dry_run)
{
@@ -1069,8 +1069,7 @@ int push_unpushed_submodules(struct oid_array *commits,
for (i = 0; i < needs_pushing.nr; i++)
submodule_push_check(needs_pushing.items[i].string,
- head, remote,
- refspec, refspec_nr);
+ head, remote, rs);
free(head);
}
@@ -1078,7 +1077,7 @@ int push_unpushed_submodules(struct oid_array *commits,
for (i = 0; i < needs_pushing.nr; i++) {
const char *path = needs_pushing.items[i].string;
fprintf(stderr, "Pushing submodule '%s'\n", path);
- if (!push_submodule(path, remote, refspec, refspec_nr,
+ if (!push_submodule(path, remote, rs,
push_options, dry_run)) {
fprintf(stderr, "Unable to push submodule '%s'\n", path);
ret = 0;