diff --git a/services/repository/contributors_graph.go b/services/repository/contributors_graph.go index 41c9c4f8ab..fa2d2360ec 100644 --- a/services/repository/contributors_graph.go +++ b/services/repository/contributors_graph.go @@ -161,6 +161,10 @@ func getExtendedCommitStats(repo *git.Repository, revision string /*, limit int break } coAuthorName, coAuthorEmail, err := util.ParseCommitTrailerValueWithAuthor(line) + if authorEmail == coAuthorEmail { + // Authors shouldn't be co-authors too. + continue + } if err != nil { continue } diff --git a/tests/gitea-repositories-meta/user2/repo2.git/objects/ab/60139e57bea4f9dc090a72cf97b7236d152a4b b/tests/gitea-repositories-meta/user2/repo2.git/objects/ab/60139e57bea4f9dc090a72cf97b7236d152a4b new file mode 100644 index 0000000000..5c4919fb1b Binary files /dev/null and b/tests/gitea-repositories-meta/user2/repo2.git/objects/ab/60139e57bea4f9dc090a72cf97b7236d152a4b differ diff --git a/tests/gitea-repositories-meta/user2/repo2.git/objects/f7/eee4e802f39ec0dadc5f872c86d4ee440b741d b/tests/gitea-repositories-meta/user2/repo2.git/objects/f7/eee4e802f39ec0dadc5f872c86d4ee440b741d new file mode 100644 index 0000000000..1e3c7faf58 Binary files /dev/null and b/tests/gitea-repositories-meta/user2/repo2.git/objects/f7/eee4e802f39ec0dadc5f872c86d4ee440b741d differ diff --git a/tests/gitea-repositories-meta/user2/repo2.git/refs/heads/branch-with-duplicated-co-author-entries b/tests/gitea-repositories-meta/user2/repo2.git/refs/heads/branch-with-duplicated-co-author-entries index c17567e1fb..f8c5eee90d 100644 --- a/tests/gitea-repositories-meta/user2/repo2.git/refs/heads/branch-with-duplicated-co-author-entries +++ b/tests/gitea-repositories-meta/user2/repo2.git/refs/heads/branch-with-duplicated-co-author-entries @@ -1 +1 @@ -79a64f10ca2ea21fa2a94102751f0dd9f2c15ce8 +f7eee4e802f39ec0dadc5f872c86d4ee440b741d