From d21590d890c9bba148274ab4cfe27c3cc463c3eb Mon Sep 17 00:00:00 2001 From: nobody Date: Mon, 9 Jan 2023 14:46:34 +0800 Subject: [PATCH] add commits to visited when iterating through history --- git-s3-push.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/git-s3-push.go b/git-s3-push.go index 977a305..e621d2d 100644 --- a/git-s3-push.go +++ b/git-s3-push.go @@ -199,8 +199,10 @@ func (repo *Repository) FindUnpushedModifiedFiles() error { for i := 0; i < currentCommit.ParentCount(); i++ { parentCommit := currentCommit.Parent(i) - if !visited.Contains(parentCommit) { + cid := parentCommit.Id().String() + if !visited.Contains(cid) { queue = append(queue, parentCommit) + visited.Add(cid) } }