real_path: resolve symlinks by hand
authorBrandon Williams <bmwill@google.com>
Mon, 12 Dec 2016 18:16:52 +0000 (10:16 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 12 Dec 2016 23:22:32 +0000 (15:22 -0800)
commit05b458c104708141d2fad211d79703b3b99cc5a8
tree54ba82f179703c3d08ac58b7e6f72746c238daa2
parent8d7a455ed52e2a96debc080dfc011b6bb00db5d2
real_path: resolve symlinks by hand

The current implementation of real_path uses chdir() in order to resolve
symlinks.  Unfortunately this isn't thread-safe as chdir() affects a
process as a whole and not just an individual thread.  Instead perform
the symlink resolution by hand so that the calls to chdir() can be
removed, making real_path one step closer to being reentrant.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
abspath.c