@Override public boolean isClean() { return index.isClean(); }
@Override public boolean isClean() { return index.isClean(); }
checkState(workingTree().isClean(), "The working tree has unstaged changes. It must be clean for the import to run cleanly."); checkState(stagingArea().isClean(), "The staging ares has uncommitted changes. It must be clean for the import to run cleanly.");
checkState(workingTree().isClean(), "The working tree has unstaged changes. It must be clean for the import to run cleanly."); checkState(stagingArea().isClean(), "The staging ares has uncommitted changes. It must be clean for the import to run cleanly.");
boolean stagingAreaClean = stagingArea().isClean(); if (workingTreeClean && stagingAreaClean) { refDatabase.putSymRef(WORK_HEAD, name);
boolean stagingAreaClean = stagingArea().isClean(); if (workingTreeClean && stagingAreaClean) { refDatabase.putSymRef(WORK_HEAD, name);
final boolean indexClean = stagingArea().isClean(); final boolean workTreeClean = workingTree().isClean(); Preconditions.checkState((indexClean && workTreeClean) || abort || continueRevert,
/** * Executes the map command using the provided options. */ @Override protected void runInternal(GeogigCLI cli) throws IOException { if (args == null || args.isEmpty() || args.size() != 1) { printUsage(cli); throw new CommandFailedException(); } checkState(cli.getGeogig().getRepository().index().isClean() && cli.getGeogig().getRepository().workingTree().isClean(), "Working tree and index are not clean"); String mappingFilepath = args.get(0); Mapping mapping = Mapping.fromFile(mappingFilepath); geogig = cli.getGeogig(); ObjectId oldTreeId = geogig.getRepository().workingTree().getTree().getId(); message = message == null ? "Applied mapping " + new File(mappingFilepath).getName() : message; ObjectId newTreeId = geogig.command(OSMMapOp.class).setMapping(mapping).setMessage(message) .call().getId(); Console console = cli.getConsole(); if (newTreeId.equals(oldTreeId)) { console.println("No features matched the specified filter, or they provided no updated data.\n" + "No changes have been made to the working tree"); } else { // print something? } }
if (!stagingArea().isClean() || !workingTree().isClean()) { throw new CheckoutException(StatusCode.LOCAL_CHANGES_NOT_COMMITTED);
checkState(stagingArea().isClean() && workingTree().isClean(), "You must have a clean working tree and index to perform a revert.");
if (!stagingArea().isClean() || !workingTree().isClean()) { throw new CheckoutException(StatusCode.LOCAL_CHANGES_NOT_COMMITTED);
final String currentBranch = headRef.getTarget(); Preconditions.checkState(stagingArea().isClean() && workingTree().isClean(), "You must have a clean working tree and index to perform a squash.");
final String currentBranch = headRef.getTarget(); Preconditions.checkState(stagingArea().isClean() && workingTree().isClean(), "You must have a clean working tree and index to perform a squash.");
final SymRef headRef = (SymRef) currHead.get(); Preconditions.checkState(stagingArea().isClean() && workingTree().isClean(), "You must have a clean working tree and index to perform a cherry pick.");
final SymRef headRef = (SymRef) currHead.get(); Preconditions.checkState(stagingArea().isClean() && workingTree().isClean(), "You must have a clean working tree and index to perform a cherry pick.");
"Filters cannot be used when updating"); GeoGIG geogig = cli.getGeogig(); checkState(geogig.getRepository().index().isClean() && geogig.getRepository().workingTree().isClean(), "Working tree and index are not clean");