Merge branch 'jl/maint-submodule-recurse-fetch' into maint
authorJunio C Hamano <gitster@pobox.com>
Wed, 2 May 2012 04:12:25 +0000 (21:12 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 2 May 2012 04:12:25 +0000 (21:12 -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

1  2 
builtin/fetch.c
diff --combined builtin/fetch.c
index 65f5f9b72f92ec64ac5ad1ad264f78199337aba6,996a4d62529dea72e6151662f4733d73e24cdb2b..cfb43df4e843970a7ff93078ea1bcbbdb9985260
@@@ -300,11 -300,11 +300,11 @@@ static int update_local_ref(struct 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 ? '!' : '*',
@@@ -585,7 -585,7 +585,7 @@@ static void find_non_local_tags(struct 
  
        for_each_ref(add_existing, &existing_refs);
        for (ref = transport_get_remote_refs(transport); ref; ref = ref->next) {
 -              if (prefixcmp(ref->name, "refs/tags"))
 +              if (prefixcmp(ref->name, "refs/tags/"))
                        continue;
  
                /*