On Sat, 5 Jul 2014, Karsten Blees wrote:

> '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 <bl...@dcon.de>
> ---
> This fixes a bug on Windows with long paths [1].
> [1] https://github.com/msysgit/msysgit/issues/227

For context: on Windows, PATH_MAX is ridiculously small. And it really is
that small, file functions of the Win32 API cannot handle longer paths.

However, there is a (pretty ugly, if you ask me) workaround: prefixing the
paths with "\\?\" and lo and behold, *many* (but not all) Win32 API
functions can then handle paths up to something around 32,000 characters!

The problem Karsten addressed here is caused exactly by this oddity: we
*can* handle paths much longer than PATH_MAX. Therefore, we need to
decouple the path buffers from that hardcoded limitation.

Karsten, you rock.

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to