Browse Source

Merge branch 'bg/maint-remote-update-default' into maint

* bg/maint-remote-update-default:
  Fix "git remote update" with remotes.defalt set
maint
Junio C Hamano 15 years ago
parent
commit
66276d972c
  1. 10
      builtin-remote.c
  2. 14
      t/t5505-remote.sh

10
builtin-remote.c

@ -1238,13 +1238,11 @@ static int update(int argc, const char **argv) @@ -1238,13 +1238,11 @@ static int update(int argc, const char **argv)
fetch_argv[fetch_argc++] = "--prune";
if (verbose)
fetch_argv[fetch_argc++] = "-v";
if (argc < 2) {
fetch_argv[fetch_argc++] = "--multiple";
if (argc < 2)
fetch_argv[fetch_argc++] = "default";
} else {
fetch_argv[fetch_argc++] = "--multiple";
for (i = 1; i < argc; i++)
fetch_argv[fetch_argc++] = argv[i];
}
for (i = 1; i < argc; i++)
fetch_argv[fetch_argc++] = argv[i];

if (strcmp(fetch_argv[fetch_argc-1], "default") == 0) {
git_config(get_remote_default, &default_defined);

14
t/t5505-remote.sh

@ -419,6 +419,20 @@ test_expect_success 'update default (overridden, with funny whitespace)' ' @@ -419,6 +419,20 @@ test_expect_success 'update default (overridden, with funny whitespace)' '

'

test_expect_success 'update (with remotes.default defined)' '

(cd one &&
for b in $(git branch -r)
do
git branch -r -d $b || break
done &&
git config remotes.default "drosophila" &&
git remote update &&
git branch -r > output &&
test_cmp expect output)

'

test_expect_success '"remote show" does not show symbolic refs' '

git clone one three &&

Loading…
Cancel
Save