aboutsummaryrefslogtreecommitdiff
path: root/apply.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2026-03-04 10:53:01 -0800
committerJunio C Hamano <gitster@pobox.com>2026-03-04 10:53:01 -0800
commit1ebfc2171310ed5ca2bcd8c1255d45f03e56dda7 (patch)
tree1c68f1f53ae272a8edeae8f258fd3ef22a3b570d /apply.c
parent8f760e7e8b67c067b829d81a9f32fb7c3fbcd6b9 (diff)
parent0fbf380daf1367a5c203eb25b744f55634dab251 (diff)
downloadgit-1ebfc2171310ed5ca2bcd8c1255d45f03e56dda7.tar.xz
Merge branch 'jr/apply-directory-normalize'
"git apply --directory=./un/../normalized/path" now normalizes the given path before using it. * jr/apply-directory-normalize: apply: normalize path in --directory argument
Diffstat (limited to 'apply.c')
-rw-r--r--apply.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/apply.c b/apply.c
index d044c95d50..b6dd1066a0 100644
--- a/apply.c
+++ b/apply.c
@@ -5022,6 +5022,10 @@ static int apply_option_parse_directory(const struct option *opt,
strbuf_reset(&state->root);
strbuf_addstr(&state->root, arg);
+
+ if (strbuf_normalize_path(&state->root) < 0)
+ return error(_("unable to normalize directory: '%s'"), arg);
+
strbuf_complete(&state->root, '/');
return 0;
}