diff options
author | Martin Erik Werner <martinerikwerner@gmail.com> | 2014-02-04 15:25:19 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-02-04 12:08:49 -0800 |
commit | ddc2a6281595fd24ea01497c496f88c40a59562f (patch) | |
tree | 071cfd96fe12b59ecd55d978b038c28ecbbba4c5 /t/t7601-merge-pull-config.sh | |
parent | t0060: add tests for prefix_path when path begins with work tree (diff) | |
download | tgif-ddc2a6281595fd24ea01497c496f88c40a59562f.tar.xz |
setup: add abspath_part_inside_repo() function
In order to extract the part of an absolute path which lies inside the
repo, it is not possible to directly use real_path, since that would
dereference symlinks both outside and inside the work tree.
Add an abspath_part_inside_repo() function which first checks if the
work tree is already the prefix, then incrementally checks each path
level by temporarily NUL-terminating at each '/' and comparing against
the work tree path. If a match is found, it overwrites the input path
with the remainder past the work tree (which will be the part inside the
work tree).
This function is currently only intended for use in
'prefix_path_gently'.
Signed-off-by: Martin Erik Werner <martinerikwerner@gmail.com>
Reviewed-by: Duy Nguyen <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7601-merge-pull-config.sh')
0 files changed, 0 insertions, 0 deletions