Package org.locationtech.geogig.api.porcelain

Examples of org.locationtech.geogig.api.porcelain.ResetOp


    public void runInternal(GeogigCLI cli) {
        final GeoGIG geogig = cli.getGeogig();

        ResetMode mode = resolveResetMode();

        ResetOp reset = cli.getGeogig().command(ResetOp.class);
        try {
            for (int i = 0; args != null && i < args.size(); i++) {
                reset.addPattern(args.get(i));
            }

            if (commit != null && commit.size() > 0) {
                Optional<ObjectId> commitId = geogig.command(RevParse.class)
                        .setRefSpec(commit.get(0)).call();
                checkParameter(commitId.isPresent(), "Commit could not be resolved.");
                reset.setCommit(Suppliers.ofInstance(commitId.get()));
            }

            reset.setMode(mode);

            reset.call();
        } catch (IllegalArgumentException iae) {
            throw new CommandFailedException(iae.getMessage(), iae);
        } catch (IllegalStateException ise) {
            throw new CommandFailedException(ise.getMessage(), ise);
        }
View Full Code Here

TOP

Related Classes of org.locationtech.geogig.api.porcelain.ResetOp

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.