forked from Qortal/qortal
Don't allow a new layer to be created if it matches the existing state.
This commit is contained in:
parent
9c20967d24
commit
a6154cbb43
@ -49,6 +49,7 @@ public class ArbitraryDataDiff {
|
||||
this.hashPreviousState();
|
||||
this.findAddedOrModifiedFiles();
|
||||
this.findRemovedFiles();
|
||||
this.validate();
|
||||
this.writeMetadata();
|
||||
|
||||
} finally {
|
||||
@ -222,6 +223,12 @@ public class ArbitraryDataDiff {
|
||||
}
|
||||
}
|
||||
|
||||
private void validate() {
|
||||
if (this.addedPaths.isEmpty() && this.modifiedPaths.isEmpty() && this.removedPaths.isEmpty()) {
|
||||
throw new IllegalStateException("Current state matches previous state. Nothing to do.");
|
||||
}
|
||||
}
|
||||
|
||||
private void writeMetadata() throws IOException {
|
||||
ArbitraryDataMetadataPatch metadata = new ArbitraryDataMetadataPatch(this.diffPath);
|
||||
metadata.setAddedPaths(this.addedPaths);
|
||||
|
Loading…
Reference in New Issue
Block a user