From a5ed69e772783eb345e63663cfdf1987e698180d Mon Sep 17 00:00:00 2001 From: Masaya Suzuki Date: Wed, 3 Jan 2024 18:08:18 -0800 Subject: [PATCH] [MER-3361] Do not delete the branchmeta for the merged branches in tidy Happened to find this bug. We should not delete branchmeta until the actual git-branch is pruned, which is done in av stack sync. Otherwise, this screws up sync. --- cmd/av/stack_tidy.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cmd/av/stack_tidy.go b/cmd/av/stack_tidy.go index 9e9c4a38..6c32b0f1 100644 --- a/cmd/av/stack_tidy.go +++ b/cmd/av/stack_tidy.go @@ -89,10 +89,8 @@ func findNonDeletedParents( branches map[string]*meta.Branch, ) map[string]meta.BranchState { deleted := make(map[string]bool) - for name, br := range branches { - if br.MergeCommit != "" { - deleted[name] = true - } else if _, err := repo.Git("show-ref", "refs/heads/"+name); err != nil { + for name := range branches { + if _, err := repo.Git("show-ref", "refs/heads/"+name); err != nil { // Ref doesn't exist. Should be removed. deleted[name] = true }