summaryrefslogtreecommitdiff
path: root/submodule.c
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2018-05-16 22:58:23 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-17 21:19:44 (GMT)
commit60fba4bf1670e6eabd61b04ebf86efedff866a50 (patch)
tree3842f24ebf2123b8359ceedc9818377e83dbd085 /submodule.c
parentafb1aed403de404c1e09fae5b8028f6b8f6982d3 (diff)
downloadgit-60fba4bf1670e6eabd61b04ebf86efedff866a50.zip
git-60fba4bf1670e6eabd61b04ebf86efedff866a50.tar.gz
git-60fba4bf1670e6eabd61b04ebf86efedff866a50.tar.bz2
submodule: convert push_unpushed_submodules to take a struct refspec
Convert 'push_unpushed_submodules()' to take a 'struct refspec' as a parameter instead of an array of 'const char *'. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 74d35b2..cdeadd8 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;