From 2a41e76b39f8279400e42f3e0dc45f55457e2cff Mon Sep 17 00:00:00 2001 From: Lewis Marshall Date: Sun, 21 May 2017 23:57:03 -0700 Subject: swarm/api: Fix adding paths which exist as manifests (#14482) Signed-off-by: Lewis Marshall --- swarm/api/manifest.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'swarm/api/manifest.go') diff --git a/swarm/api/manifest.go b/swarm/api/manifest.go index dbaaf4bff..e251620a7 100644 --- a/swarm/api/manifest.go +++ b/swarm/api/manifest.go @@ -237,12 +237,12 @@ func (self *manifestTrie) addEntry(entry *manifestTrieEntry, quitC chan bool) { } b := byte(entry.Path[0]) - if (self.entries[b] == nil) || (self.entries[b].Path == entry.Path) { + oldentry := self.entries[b] + if (oldentry == nil) || (oldentry.Path == entry.Path && oldentry.ContentType != ManifestType) { self.entries[b] = entry return } - oldentry := self.entries[b] cpl := 0 for (len(entry.Path) > cpl) && (len(oldentry.Path) > cpl) && (entry.Path[cpl] == oldentry.Path[cpl]) { cpl++ -- cgit