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:
authorJunio C Hamano <gitster@pobox.com>2010-02-24 21:22:06 +0300
committerJunio C Hamano <gitster@pobox.com>2010-02-24 21:51:07 +0300
commitbba5322a71a3399a94f53e1dddf5bd66e493dfbc (patch)
treefa2a9a6d85494c785381d830119f600a7c3c68a6 /builtin-fetch.c
parent13e65fe6314bf44e64f22b9b66a4e5940adaa2e5 (diff)
builtin-fetch --all/--multi: propagate options correctly
When running a subfetch, the code propagated some options but not others. Propagate --force, --update-head-ok and --keep options as well. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-fetch.c')
-rw-r--r--builtin-fetch.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/builtin-fetch.c b/builtin-fetch.c
index 8654fa7a2d..61b2e4060c 100644
--- a/builtin-fetch.c
+++ b/builtin-fetch.c
@@ -784,13 +784,19 @@ static int add_remote_or_group(const char *name, struct string_list *list)
static int fetch_multiple(struct string_list *list)
{
int i, result = 0;
- const char *argv[] = { "fetch", NULL, NULL, NULL, NULL, NULL, NULL };
+ const char *argv[10] = { "fetch" };
int argc = 1;
if (dry_run)
argv[argc++] = "--dry-run";
if (prune)
argv[argc++] = "--prune";
+ if (update_head_ok)
+ argv[argc++] = "--update-head-ok";
+ if (force)
+ argv[argc++] = "--force";
+ if (keep)
+ argv[argc++] = "--keep";
if (verbosity >= 2)
argv[argc++] = "-v";
if (verbosity >= 1)
@@ -801,6 +807,7 @@ static int fetch_multiple(struct string_list *list)
for (i = 0; i < list->nr; i++) {
const char *name = list->items[i].string;
argv[argc] = name;
+ argv[argc + 1] = NULL;
if (verbosity >= 0)
printf("Fetching %s\n", name);
if (run_command_v_opt(argv, RUN_GIT_CMD)) {