Merge branch 'tg/ce-namelen-field'
[gitweb.git] / read-cache.c
index ac13bca03dc334062d809612d674135f0bcf46ad..2f8159fb165f853aafb5e0cee61f35aa854271ec 100644 (file)
@@ -1128,7 +1128,7 @@ int refresh_index(struct index_state *istate, unsigned int flags, const char **p
                        continue;
 
                if (pathspec &&
-                   !match_pathspec(pathspec, ce->name, strlen(ce->name), 0, seen))
+                   !match_pathspec(pathspec, ce->name, ce_namelen(ce), 0, seen))
                        filtered = 1;
 
                if (ce_stage(ce)) {
@@ -1856,7 +1856,7 @@ int read_index_unmerged(struct index_state *istate)
                if (!ce_stage(ce))
                        continue;
                unmerged = 1;
-               len = strlen(ce->name);
+               len = ce_namelen(ce);
                size = cache_entry_size(len);
                new_ce = xcalloc(1, size);
                memcpy(new_ce->name, ce->name, len);