warren830 commented on code in PR #3062:
URL: https://github.com/apache/incubator-devlake/pull/3062#discussion_r971465409


##########
plugins/gitextractor/parser/repo.go:
##########
@@ -329,15 +332,20 @@ func (r *GitRepo) storeCommitFilesFromDiff(commitSha 
string, diff *git.Diff, com
                commitFile = new(code.CommitFile)
                commitFile.CommitSha = commitSha
                commitFile.FilePath = file.NewFile.Path
-               commitFile.Id = commitSha + ":" + file.NewFile.Path
+
+               // use commitSha and the sha256 of FilePath to create id
+               shaFilePath := sha256.New()
+               shaFilePath.Write([]byte(file.NewFile.Path))
+               commitFile.Id = commitSha + ":" + 
hex.EncodeToString(shaFilePath.Sum(nil))

Review Comment:
   can you comment on why you are doing this?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to