protected function addFilesystemResource($path, FilesystemResource $resource)
    {
        $resource = clone $resource;
        $resource->attachTo($this, $path);

        $relativePath = Path::makeRelative($resource->getFilesystemPath(), $this->baseDirectory);

        $this->insertReference($path, $relativePath);

        $this->storeVersion($resource);
    }