diff --git a/src/python/jw/pkg/App.py b/src/python/jw/pkg/App.py index 7abc3040..cffb1972 100644 --- a/src/python/jw/pkg/App.py +++ b/src/python/jw/pkg/App.py @@ -199,25 +199,24 @@ class App(Base): ), ) vals_list = vals.split(',') if vals else [] - match scope: - case Scope.Self: - buf += vals_list - case Scope.One | Scope.Subtree: - subscope = scope.Self if scope == Scope.One else scope - for val in vals_list: - val = val.strip() - if not (len(val)): - continue - self.__get_project_refs( - buf, - visited, - val, - section, - key, - add_self = True, - scope = subscope, - names_only = names_only, - ) + if scope != Scope.Self: + # Scope.Self adds the node itself (if add_self), but not its + # children, so stop recursing here + subscope = scope.Self if scope == Scope.One else scope + for val in vals_list: + val = val.strip() + if not (len(val)): + continue + self.__get_project_refs( + buf, + visited, + val, + section, + key, + add_self = True, + scope = subscope, + names_only = names_only, + ) if add_self: buf.append(spec)