tools/patches/d2/self_referencing_connections.patch
Dmitriy Pleshevskiy 2b3fe47333
d2: bump to latest master
- d2/patches: expose autoformat subcommand
- d2/patches: update self referencing connection to latest master
2022-12-01 16:04:04 +03:00

25 lines
608 B
Diff

diff --git a/d2graph/d2graph.go b/d2graph/d2graph.go
index 5e3f5e5..c2d5511 100644
--- a/d2graph/d2graph.go
+++ b/d2graph/d2graph.go
@@ -721,20 +721,16 @@ func (obj *Object) Connect(srcID, dstID []string, srcArrow, dstArrow bool, label
return nil, errors.New("cannot connect to reserved keyword")
}
}
}
src := srcObj.EnsureChild(srcID)
dst := dstObj.EnsureChild(dstID)
- if src == dst {
- return nil, errors.New("self-referencing connection")
- }
-
edge := &Edge{
Attributes: Attributes{
Label: Scalar{
Value: label,
},
},
Src: src,
SrcArrow: srcArrow,