protected void targetBranch(String branch) {
    Preconditions.checkArgument(branch != null, "Invalid branch name: null");
    boolean refExists = base.ref(branch) != null;
    Preconditions.checkArgument(
        !refExists || base.ref(branch).isBranch(),
        "%s is a tag, not a branch. Tags cannot be targets for producing snapshots",
        branch);
    this.targetBranch = branch;
  }
A setter for the target branch on which snapshot producer operation should be performed

@param branch to set as target branch
iceberg/patched-iceberg-core/src/main/java/org/apache/iceberg/SnapshotProducer.java