From e7c730530065fb2f366ecbcb1e71d7f7346b6a25 Mon Sep 17 00:00:00 2001 From: Karsten Blees Date: Sat, 5 Jul 2014 00:41:46 +0200 Subject: symlinks: remove PATH_MAX limitation 'git checkout' fails if a directory is longer than PATH_MAX, because the lstat_cache in symlinks.c checks if the leading directory exists using PATH_MAX-bounded string operations. Remove the limitation by using strbuf instead. Signed-off-by: Karsten Blees Signed-off-by: Junio C Hamano --- preload-index.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'preload-index.c') diff --git a/preload-index.c b/preload-index.c index 968ee25eae..79ce8a998b 100644 --- a/preload-index.c +++ b/preload-index.c @@ -37,9 +37,8 @@ static void *preload_thread(void *_data) struct thread_data *p = _data; struct index_state *index = p->index; struct cache_entry **cep = index->cache + p->offset; - struct cache_def cache; + struct cache_def cache = CACHE_DEF_INIT; - memset(&cache, 0, sizeof(cache)); nr = p->nr; if (nr + p->offset > index->cache_nr) nr = index->cache_nr - p->offset; @@ -64,6 +63,7 @@ static void *preload_thread(void *_data) continue; ce_mark_uptodate(ce); } while (--nr > 0); + cache_def_free(&cache); return NULL; } -- cgit v1.2.3