replace == by HasPrefix for names and improve error message

This commit is contained in:
Victor Vieux
2013-10-17 19:43:25 +00:00
parent 387aeb78fb
commit c4923757f1
3 changed files with 7 additions and 4 deletions
+1 -1
View File
@@ -518,7 +518,7 @@ func (runtime *Runtime) RenameLink(oldName, newName string) error {
// This is not rename but adding a new link for the default name
// Strip the leading '/'
if entity.ID() == oldName[1:] {
if strings.HasPrefix(entity.ID(), oldName[1:]) {
_, err := runtime.containerGraph.Set(newName, entity.ID())
return err
}