Browse Source

builtin/fetch.c: respect 'submodule.recurse' option

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Stefan Beller 8 years ago committed by Junio C Hamano
parent
commit
58f4203e7d
  1. 7
      builtin/fetch.c
  2. 10
      t/t5526-fetch-submodules.sh

7
builtin/fetch.c

@ -73,6 +73,13 @@ static int git_fetch_config(const char *k, const char *v, void *cb) @@ -73,6 +73,13 @@ static int git_fetch_config(const char *k, const char *v, void *cb)
fetch_prune_config = git_config_bool(k, v);
return 0;
}

if (!strcmp(k, "submodule.recurse")) {
int r = git_config_bool(k, v) ?
RECURSE_SUBMODULES_ON : RECURSE_SUBMODULES_OFF;
recurse_submodules = r;
}

return git_default_config(k, v, cb);
}


10
t/t5526-fetch-submodules.sh

@ -71,6 +71,16 @@ test_expect_success "fetch --recurse-submodules recurses into submodules" ' @@ -71,6 +71,16 @@ test_expect_success "fetch --recurse-submodules recurses into submodules" '
test_i18ncmp expect.err actual.err
'

test_expect_success "submodule.recurse option triggers recursive fetch" '
add_upstream_commit &&
(
cd downstream &&
git -c submodule.recurse fetch >../actual.out 2>../actual.err
) &&
test_must_be_empty actual.out &&
test_i18ncmp expect.err actual.err
'

test_expect_success "fetch --recurse-submodules -j2 has the same output behaviour" '
add_upstream_commit &&
(

Loading…
Cancel
Save