1
0
mirror of https://github.com/git/git.git synced 2024-10-22 12:28:32 +02:00

Merge branch 'tg/ce-namelen'

Trivially correct clean-up and micro optimization.

* tg/ce-namelen:
  Replace strlen() with ce_namelen()
This commit is contained in:
Junio C Hamano 2012-07-13 15:37:58 -07:00
commit 4495f88cd8
2 changed files with 3 additions and 3 deletions

@ -1119,7 +1119,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)) {
@ -1841,7 +1841,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);

@ -1296,7 +1296,7 @@ static int verify_clean_subdirectory(struct cache_entry *ce,
* First let's make sure we do not have a local modification
* in that directory.
*/
namelen = strlen(ce->name);
namelen = ce_namelen(ce);
for (i = locate_in_src_index(ce, o);
i < o->src_index->cache_nr;
i++) {