Skip to content

Commit 81a5bdd

Browse files
committed
Sync with 1.7.6.3
Signed-off-by: Junio C Hamano <[email protected]>
2 parents e494503 + 740a8fc commit 81a5bdd

File tree

4 files changed

+19
-7
lines changed

4 files changed

+19
-7
lines changed

Documentation/RelNotes/1.7.6.3.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ Fixes since v1.7.6.2
77
* "git -c var=value subcmd" misparsed the custom configuration when
88
value contained an equal sign.
99

10+
* "git fetch" had a major performance regression, wasting many
11+
needless cycles in a repository where there is no submodules
12+
present. This was especially bad, when there were many refs.
13+
1014
* "git reflog $refname" did not default to the "show" subcommand as
1115
the documentation advertised the command to do.
1216

Documentation/git.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ unreleased) version of git, that is available from 'master'
4444
branch of the `git.git` repository.
4545
Documentation for older releases are available here:
4646

47-
* link:v1.7.6.2/git.html[documentation for release 1.7.6.2]
47+
* link:v1.7.6.3/git.html[documentation for release 1.7.6.3]
4848

4949
* release notes for
50+
link:RelNotes/1.7.6.3.txt[1.7.6.3],
5051
link:RelNotes/1.7.6.2.txt[1.7.6.2],
5152
link:RelNotes/1.7.6.1.txt[1.7.6.1],
5253
link:RelNotes/1.7.6.txt[1.7.6].

builtin/fetch.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -941,6 +941,15 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
941941
argc = parse_options(argc, argv, prefix,
942942
builtin_fetch_options, builtin_fetch_usage, 0);
943943

944+
if (recurse_submodules != RECURSE_SUBMODULES_OFF) {
945+
if (recurse_submodules_default) {
946+
int arg = parse_fetch_recurse_submodules_arg("--recurse-submodules-default", recurse_submodules_default);
947+
set_config_fetch_recurse_submodules(arg);
948+
}
949+
gitmodules_config();
950+
git_config(submodule_config, NULL);
951+
}
952+
944953
if (all) {
945954
if (argc == 1)
946955
die(_("fetch --all does not take a repository argument"));
@@ -976,12 +985,6 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
976985
if (!result && (recurse_submodules != RECURSE_SUBMODULES_OFF)) {
977986
const char *options[10];
978987
int num_options = 0;
979-
if (recurse_submodules_default) {
980-
int arg = parse_fetch_recurse_submodules_arg("--recurse-submodules-default", recurse_submodules_default);
981-
set_config_fetch_recurse_submodules(arg);
982-
}
983-
gitmodules_config();
984-
git_config(submodule_config, NULL);
985988
add_options_to_argv(&num_options, options);
986989
result = fetch_populated_submodules(num_options, options,
987990
submodule_prefix,

submodule.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,10 @@ void check_for_new_submodule_commits(unsigned char new_sha1[20])
481481
const char *argv[] = {NULL, NULL, "--not", "--all", NULL};
482482
int argc = ARRAY_SIZE(argv) - 1;
483483

484+
/* No need to check if there are no submodules configured */
485+
if (!config_name_for_path.nr)
486+
return;
487+
484488
init_revisions(&rev, NULL);
485489
argv[1] = xstrdup(sha1_to_hex(new_sha1));
486490
setup_revisions(argc, argv, &rev, NULL);

0 commit comments

Comments
 (0)