dir.c: avoid stat() in valid_cached_dir()
[gitweb.git] / unpack-trees.c
index 0dc76eddfe760249059f8caa667c990c7a0a3bb8..bf8b6029013c31000d83d6292f83ce0d0021d5d4 100644 (file)
@@ -14,6 +14,7 @@
 #include "dir.h"
 #include "submodule.h"
 #include "submodule-config.h"
+#include "fsmonitor.h"
 
 /*
  * Error messages expected by scripts out of plumbing commands such as
@@ -408,6 +409,7 @@ static int apply_sparse_checkout(struct index_state *istate,
                ce->ce_flags &= ~CE_SKIP_WORKTREE;
        if (was_skip_worktree != ce_skip_worktree(ce)) {
                ce->ce_flags |= CE_UPDATE_IN_BASE;
+               mark_fsmonitor_invalid(istate, ce);
                istate->cache_changed |= CE_ENTRY_CHANGED;
        }
 
@@ -1542,7 +1544,7 @@ static int verify_clean_subdirectory(const struct cache_entry *ce,
 
        if (S_ISGITLINK(ce->ce_mode)) {
                struct object_id oid;
-               int sub_head = resolve_gitlink_ref(ce->name, "HEAD", oid.hash);
+               int sub_head = resolve_gitlink_ref(ce->name, "HEAD", &oid);
                /*
                 * If we are not going to update the submodule, then
                 * we don't care.