Thread (1 message) 1 message, 1 author, 2016-12-27

Re: [PATCHv5 4/4] rm: absorb a submodules git dir before deletion

From: Junio C Hamano <hidden>
Date: 2016-12-27 21:56:27

Stefan Beller [off-list ref] writes:
quoted
quoted
quoted
@@ -358,9 +331,6 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
                      oidclr(&oid);
              if (check_local_mod(&oid, index_only))
                      exit(1);
-     } else if (!index_only) {
-             if (check_submodules_use_gitfiles())
-                     exit(1);
      }
Hmph.  It may be a bit strange to see an "index-only" remove to
touch working tree, no?  Yet submodules_absorb_gitdir_if_needed() is
unconditionally called above, which feels somewhat unexpected.
...
Well scratch that.
is_staging_gitmodules_ok only checks for the .gitmodules file and not
for the submodule itself (the submodule is not an argument to that function)

The actual answer is found in check_local_mod called via

    if (!force) {
        struct object_id oid;
        if (get_oid("HEAD", &oid))
            oidclr(&oid);
        if (check_local_mod(&oid, index_only))
            exit(1);
    }
OK, that happens way before this loop starts finding submodules and
removing them, so we can say that the latter is well protected.

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help