From d5acd04aa729faf81feec82dc3b98f060af6d4d6 Mon Sep 17 00:00:00 2001 From: Tiago Natel Date: Mon, 10 Jan 2022 10:18:41 +0000 Subject: [PATCH] fix: stacks listed twice --- manager.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/manager.go b/manager.go index 96c483126..02f52ed53 100644 --- a/manager.go +++ b/manager.go @@ -25,6 +25,7 @@ import ( "github.com/mineiros-io/terramate/git" "github.com/mineiros-io/terramate/hcl" + "github.com/mineiros-io/terramate/project" "github.com/mineiros-io/terramate/stack" "github.com/rs/zerolog/log" ) @@ -87,6 +88,10 @@ func (m *Manager) ListChanged() ([]Entry, error) { Msg("Get dir name.") dirname := filepath.Dir(filepath.Join(m.root, path)) + if _, ok := stackSet[project.RelPath(m.root, dirname)]; ok { + continue + } + logger.Debug(). Str("path", dirname). Msg("Try load changed.") @@ -109,7 +114,7 @@ func (m *Manager) ListChanged() ([]Entry, error) { } } - stackSet[dirname] = Entry{ + stackSet[s.Dir] = Entry{ Stack: s, Reason: "stack has unmerged changes", }