mirror of
https://github.com/restic/restic.git
synced 2025-08-13 13:01:59 +00:00
tree: Improve error for pre-existing node
This commit is contained in:
@@ -48,7 +48,7 @@ func (t Tree) Equals(other *Tree) bool {
|
|||||||
func (t *Tree) Insert(node *Node) error {
|
func (t *Tree) Insert(node *Node) error {
|
||||||
pos, _, err := t.binarySearch(node.Name)
|
pos, _, err := t.binarySearch(node.Name)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return errors.New("node already present")
|
return errors.Errorf("node %q already present", node.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://code.google.com/p/go-wiki/wiki/SliceTricks
|
// https://code.google.com/p/go-wiki/wiki/SliceTricks
|
||||||
|
Reference in New Issue
Block a user