Merge branch 'jl/maint-submodule-recurse-fetch'
authorJunio C Hamano <gitster@pobox.com>
Mon, 23 Apr 2012 19:58:28 +0000 (12:58 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 23 Apr 2012 19:58:28 +0000 (12:58 -0700)
"git fetch" that recurses into submodules on demand did not check if
it needs to go into submodules when non branches (most notably, tags)
are fetched.

By Jens Lehmann
* jl/maint-submodule-recurse-fetch:
submodules: recursive fetch also checks new tags for submodule commits

builtin/fetch.c
index 65f5f9b72f92ec64ac5ad1ad264f78199337aba6..cfb43df4e843970a7ff93078ea1bcbbdb9985260 100644 (file)
@@ -300,11 +300,11 @@ static int update_local_ref(struct ref *ref,
                else {
                        msg = "storing head";
                        what = _("[new branch]");
-                       if ((recurse_submodules != RECURSE_SUBMODULES_OFF) &&
-                           (recurse_submodules != RECURSE_SUBMODULES_ON))
-                               check_for_new_submodule_commits(ref->new_sha1);
                }
 
+               if ((recurse_submodules != RECURSE_SUBMODULES_OFF) &&
+                   (recurse_submodules != RECURSE_SUBMODULES_ON))
+                       check_for_new_submodule_commits(ref->new_sha1);
                r = s_update_ref(msg, ref, 0);
                strbuf_addf(display, "%c %-*s %-*s -> %s%s",
                            r ? '!' : '*',