summaryrefslogtreecommitdiff
path: root/preload-index.c
diff options
context:
space:
mode:
authorKarsten Blees <karsten.blees@gmail.com>2014-07-05 00:41:46 +0200
committerJunio C Hamano <gitster@pobox.com>2014-07-07 11:22:42 -0700
commite7c730530065fb2f366ecbcb1e71d7f7346b6a25 (patch)
treecd6299bca9a68f2df452643eb878ba0cd2bf275f /preload-index.c
parentc2f7b1026e33e308782fcb1b60e3d7af107fdc18 (diff)
downloadgit-e7c730530065fb2f366ecbcb1e71d7f7346b6a25.tar.gz
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 <blees@dcon.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'preload-index.c')
-rw-r--r--preload-index.c4
1 files changed, 2 insertions, 2 deletions
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;
}