]> Kevux Git Server - rit/commit
apply: normalize path in --directory argument
authorJoaquim Rocha <joaquim@amutable.com>
Wed, 18 Feb 2026 00:15:32 +0000 (00:15 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 20 Feb 2026 18:12:58 +0000 (10:12 -0800)
commit0fbf380daf1367a5c203eb25b744f55634dab251
tree448cf3580b38fe07614f776fb05d50d1f0e39976
parent9a2fb147f2c61d0cab52c883e7e26f5b7948e3ed
apply: normalize path in --directory argument

When passing a relative path like --directory=./some/sub, the leading
"./" caused apply to prepend it literally to patch filenames, resulting
in an error (invalid path).
There may be more cases like this where users pass some/./path to the
directory which can easily be normalized to an acceptable path, so
these changes try to normalize the path before using it.

Signed-off-by: Joaquim Rocha <joaquim@amutable.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
apply.c
t/t4128-apply-root.sh