From: Michael Haggerty Date: Sun, 28 Oct 2012 16:16:26 +0000 (+0100) Subject: setup_git_directory_gently_1(): resolve symlinks in ceiling paths X-Git-Tag: v1.8.2-rc2~3^2~1 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/1b77d83cab798668d8a54a05b3fa0262486f7dfc?ds=inline;hp=1b77d83cab798668d8a54a05b3fa0262486f7dfc setup_git_directory_gently_1(): resolve symlinks in ceiling paths longest_ancestor_length() relies on a textual comparison of directory parts to find the part of path that overlaps with one of the paths in prefix_list. But this doesn't work if any of the prefixes involves a symbolic link, because the directories will look different even though they might logically refer to the same directory. So canonicalize the paths listed in GIT_CEILING_DIRECTORIES using real_path_if_valid() before passing them to longest_ancestor_length(). (Also rename normalize_ceiling_entry() to canonicalize_ceiling_entry() to reflect the change.) path is already in canonical form, so doesn't need to be canonicalized again. This fixes some problems with using GIT_CEILING_DIRECTORIES that contains paths involving symlinks, including t4035 if run with --root set to a path involving symlinks. Please note that test t0060 is *not* changed analogously, because that would make the test suite results dependent on the contents of the local root directory. However, real_path() is already tested independently, and the "ancestor" tests cover the non-normalization aspects of longest_ancestor_length(), so coverage remains sufficient. Signed-off-by: Michael Haggerty Signed-off-by: Jeff King ---