String treePath = featureType.getName().getLocalPart();
// check out the datastore branch on the transaction space
final String branch = getOrFigureOutBranch();
tx.command(CheckoutOp.class).setForce(true).setSource(branch).call();
// now we can use the transaction working tree with the correct branch checked out
WorkingTree workingTree = tx.workingTree();
workingTree.createTypeTree(treePath, featureType);
tx.command(AddOp.class).addPattern(treePath).call();
tx.command(CommitOp.class).setMessage("Created feature type tree " + treePath).call();
tx.commit();
} catch (IllegalArgumentException alreadyExists) {