From 8f96395f747de0198384c22435a01f77e9ed06cb Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 2 May 2023 12:17:21 +0530 Subject: [PATCH] diff kitten: Fix a regression in 0.28.0 that broke using relative paths as arguments to the kitten Fixes #6235 --- docs/changelog.rst | 2 ++ kittens/diff/collect.go | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index a99116fa3..07906415b 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -50,6 +50,8 @@ Detailed list of changes - hints kitten: Fix a regression in 0.28.0 that broke using sub-groups in regexp captures (:iss:`6228`) +- diff kitten: Fix a regression in 0.28.0 that broke using relative paths as arguments to the kitten (:iss:`6325`) + 0.28.1 [2023-04-21] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kittens/diff/collect.go b/kittens/diff/collect.go index 5e5dd84aa..99c42fe50 100644 --- a/kittens/diff/collect.go +++ b/kittens/diff/collect.go @@ -258,6 +258,10 @@ func resolve_remote_name(path, defval string) string { } func walk(base string, patterns []string, names *utils.Set[string], pmap, path_name_map map[string]string) error { + base, err := filepath.Abs(base) + if err != nil { + return err + } return filepath.WalkDir(base, func(path string, d fs.DirEntry, err error) error { is_allowed := allowed(path, patterns...) if !is_allowed {