Skip to content

Commit 47fb79c

Browse files
committed
Avoid self-loops in CHANGED_TOGETHER_WITH edges
1 parent d53826c commit 47fb79c

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

cypher/GitLog/Add_CHANGED_TOGETHER_WITH_relationships_to_code_files.cypher

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ MATCH (firstGitFile:Git&File&!Repository)-[gitChange:CHANGED_TOGETHER_WITH]-(sec
44
WHERE elementId(firstGitFile) < elementId(secondGitFile)
55
MATCH (firstGitFile)-[:RESOLVES_TO]->(firstCodeFile:File&!Git&!Repository)
66
MATCH (secondGitFile)-[:RESOLVES_TO]->(secondCodeFile:File&!Git&!Repository)
7+
WHERE firstGitFile <> secondGitFile
78
CALL (firstCodeFile, secondCodeFile, gitChange) {
89
MERGE (firstCodeFile)-[pairwiseChange:CHANGED_TOGETHER_WITH]-(secondCodeFile)
910
SET pairwiseChange = properties(gitChange)

cypher/GitLog/Add_CHANGED_TOGETHER_WITH_relationships_to_git_files.cypher

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ WHERE updateCommitCount > 2
3939
WITH *
4040
,fileCombination[0] AS firstFile
4141
,fileCombination[1] AS secondFile
42+
WHERE firstFile <> secondFile
4243
WITH *
4344
// Get the lowest number of git update commits of both files (file pair)
4445
,CASE WHEN firstFile.updateCommitCount < secondFile.updateCommitCount

0 commit comments

Comments
 (0)