diff kitten: Fix a regression in 0.28.0 that broke using relative paths as arguments to the kitten

Fixes #6235
This commit is contained in:
Kovid Goyal 2023-05-02 12:17:21 +05:30
parent 1fc4e53bea
commit 8f96395f74
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 6 additions and 0 deletions

View File

@ -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`) - 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] 0.28.1 [2023-04-21]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -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 { 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 { return filepath.WalkDir(base, func(path string, d fs.DirEntry, err error) error {
is_allowed := allowed(path, patterns...) is_allowed := allowed(path, patterns...)
if !is_allowed { if !is_allowed {