Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed catalog and collection clone logic to avoid dupe root link #72

Merged
merged 1 commit into from
Jan 29, 2020

Conversation

lossyrob
Copy link
Member

The clone methods on catalog and collection create a new version of the STAC object and set the links on the clone manually. The problem with this is that the constructor of the Catalog sets the root link to itself - this is because a root link is required on a catalog, so a new instance should always link to itself as the root. This PR adds some additional logic to ensure that there is only one root link set in the clone. If the Catalog's root link is set to itself, then the root link of the clone will be set to the clone.

Fixes #63

@lossyrob lossyrob merged commit a3d5b00 into develop Jan 29, 2020
@lossyrob lossyrob deleted the rde/fix/double-root branch January 29, 2020 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cloning catalog duplicates root link
1 participant