You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by kl...@apache.org on 2024/04/08 09:56:11 UTC

(incubator-devlake) branch main updated: Fix git commits with empty email (#7284)

This is an automated email from the ASF dual-hosted git repository.

klesh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/main by this push:
     new 6267dfaa7 Fix git commits with empty email (#7284)
6267dfaa7 is described below

commit 6267dfaa7fc71057052a5ec5e56295444270f2bd
Author: Alex Tonkonozhenko <to...@gmail.com>
AuthorDate: Mon Apr 8 11:56:06 2024 +0200

    Fix git commits with empty email (#7284)
---
 backend/plugins/gitextractor/store/database.go | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/backend/plugins/gitextractor/store/database.go b/backend/plugins/gitextractor/store/database.go
index 0638ed73e..63ec7e2de 100644
--- a/backend/plugins/gitextractor/store/database.go
+++ b/backend/plugins/gitextractor/store/database.go
@@ -76,9 +76,12 @@ func (d *Database) Commits(commit *code.Commit) errors.Error {
 		return err
 	}
 	d.updateRawDataFields(&account.RawDataOrigin)
-	err = accountBatch.Add(account)
-	if err != nil {
-		return err
+	// Skip accounts without email, such accounts fail in PostgreSQL
+	if account.Email != "" {
+		err = accountBatch.Add(account)
+		if err != nil {
+			return err
+		}
 	}
 	commitBatch, err := d.driver.ForType(reflect.TypeOf(commit))
 	if err != nil {