From 0f91efc47841141d214dda81eb81b2c4766fe378 Mon Sep 17 00:00:00 2001 From: Agent Date: Sun, 19 Apr 2026 19:53:29 +0000 Subject: [PATCH] fix: reset duplicate detection state between compose generation runs Reset _seen_services and _service_sources arrays at the start of _generate_compose_impl to prevent state bleeding between multiple invocations. This fixes the test-duplicate-service-detection.sh test which fails when run due to global associative array state persisting between test cases. Fixes: #850 --- lib/generators.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/generators.sh b/lib/generators.sh index 3053dfc..5a3a002 100644 --- a/lib/generators.sh +++ b/lib/generators.sh @@ -313,6 +313,10 @@ _generate_compose_impl() { return 0 fi + # Reset duplicate detection state for fresh run + _seen_services=() + _service_sources=() + # Initialize duplicate detection with base services defined in the template _record_service "forgejo" "base compose template" || return 1 _record_service "woodpecker" "base compose template" || return 1