commit-graph: compute generation numbers
[gitweb.git] / dir.c
diff --git a/dir.c b/dir.c
index 22cadbda9d90e1797455150096b6007dcd4dd826..536416ff2df5f7c475deba4739d4edaf340ae898 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -744,8 +744,8 @@ static struct untracked_cache_dir *lookup_untracked(struct untracked_cache *uc,
        FLEX_ALLOC_MEM(d, name, name, len);
 
        ALLOC_GROW(dir->dirs, dir->dirs_nr + 1, dir->dirs_alloc);
-       memmove(dir->dirs + first + 1, dir->dirs + first,
-               (dir->dirs_nr - first) * sizeof(*dir->dirs));
+       MOVE_ARRAY(dir->dirs + first + 1, dir->dirs + first,
+                  dir->dirs_nr - first);
        dir->dirs_nr++;
        dir->dirs[first] = d;
        return d;
@@ -846,8 +846,8 @@ static int add_excludes(const char *fname, const char *base, int baselen,
                                oidcpy(&oid_stat->oid,
                                       &istate->cache[pos]->oid);
                        else
-                               hash_sha1_file(buf, size, "blob",
-                                              oid_stat->oid.hash);
+                               hash_object_file(buf, size, "blob",
+                                                &oid_stat->oid);
                        fill_stat_data(&oid_stat->stat, &st);
                        oid_stat->valid = 1;
                }
@@ -2245,6 +2245,7 @@ int read_directory(struct dir_struct *dir, struct index_state *istate,
                   const char *path, int len, const struct pathspec *pathspec)
 {
        struct untracked_cache_dir *untracked;
+       uint64_t start = getnanotime();
 
        if (has_symlink_leading_path(path, len))
                return dir->nr;
@@ -2283,6 +2284,7 @@ int read_directory(struct dir_struct *dir, struct index_state *istate,
                dir->nr = i;
        }
 
+       trace_performance_since(start, "read directory %.*s", len, path);
        if (dir->untracked) {
                static struct trace_key trace_untracked_stats = TRACE_KEY_INIT(UNTRACKED_STATS);
                trace_printf_key(&trace_untracked_stats,