Skip to content

Commit

Permalink
Core: Reset to main as part of replace shouldn't remove main ref
Browse files Browse the repository at this point in the history
  • Loading branch information
amogh-jahagirdar committed Dec 19, 2024
1 parent 540d6a6 commit 6c4287d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions core/src/main/java/org/apache/iceberg/TableMetadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -1299,11 +1299,8 @@ public Builder removeRef(String name) {

private Builder resetMainBranch() {
this.currentSnapshotId = -1;
SnapshotRef ref = refs.remove(SnapshotRef.MAIN_BRANCH);
if (ref != null) {
changes.add(new MetadataUpdate.RemoveSnapshotRef(SnapshotRef.MAIN_BRANCH));
}

refs.remove(SnapshotRef.MAIN_BRANCH);
setBranchSnapshot(-1, SnapshotRef.MAIN_BRANCH);
return this;
}

Expand Down

0 comments on commit 6c4287d

Please sign in to comment.