Commit 96bed09b authored by Tommi Virtanen's avatar Tommi Virtanen Committed by Jeromy

dagmodifier: Don't lose pin if old and new key happen to be equal

License: MIT
Signed-off-by: default avatarJeromy <jeromyj@gmail.com>
parent 1497d51f
......@@ -209,9 +209,10 @@ func (dm *DagModifier) Sync() error {
dm.curNode = nd
}
// Finalize correct pinning, and flush pinner
dm.mp.PinWithMode(thisk, pin.Recursive)
// Finalize correct pinning, and flush pinner.
// Be careful about the order, as curk might equal thisk.
dm.mp.RemovePinWithMode(curk, pin.Recursive)
dm.mp.PinWithMode(thisk, pin.Recursive)
err = dm.mp.Flush()
if err != nil {
return err
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment