path: root/string-list.c
diff options
authorMichael Haggerty <>2012-10-28 16:16:26 (GMT)
committerJeff King <>2012-10-29 06:34:58 (GMT)
commit1b77d83cab798668d8a54a05b3fa0262486f7dfc (patch)
tree4fb68b8b55c5e54486adc75c8a6a31ea9d081cf4 /string-list.c
parent9e2326c7e1efb1ae42b17e3fa38c16711a8d0bd8 (diff)
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 <>
Diffstat (limited to 'string-list.c')
0 files changed, 0 insertions, 0 deletions