Skip to content

Commit 96cfeba

Browse files
author
Eidmantas Ivanauskas
committed
fix(git): grouping prefers explicit write branch on config; fallback to app branch
1 parent 68ab8e2 commit 96cfeba

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/argocd/git.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,9 @@ func (rw *repoWriter) flushBatch(batch []writeIntent) {
212212
func groupIntentsByBranch(batch []writeIntent) map[string][]writeIntent {
213213
byBranch := map[string][]writeIntent{}
214214
for _, wi := range batch {
215-
branch := getWriteBackBranch(wi.app)
216-
if wi.wbc.GitWriteBranch != "" {
217-
branch = wi.wbc.GitWriteBranch
215+
branch := wi.wbc.GitWriteBranch
216+
if branch == "" {
217+
branch = getWriteBackBranch(wi.app)
218218
}
219219
byBranch[branch] = append(byBranch[branch], wi)
220220
}

0 commit comments

Comments
 (0)