Package org.locationtech.geogig.api.plumbing

Examples of org.locationtech.geogig.api.plumbing.UpdateRef


        String fullPath = Ref.TAGS_PREFIX + name;
        Optional<RevObject> revTag = command(RevObjectParse.class).setRefSpec(fullPath).call();
        Preconditions.checkArgument(revTag.isPresent(), "Wrong tag name: " + name);
        Preconditions.checkArgument(revTag.get().getType().equals(RevObject.TYPE.TAG), name
                + " does not resolve to a tag");
        UpdateRef updateRef = command(UpdateRef.class).setName(fullPath).setDelete(true)
                .setReason("Delete tag " + name);
        Optional<Ref> tagRef = updateRef.call();
        checkState(tagRef.isPresent());
        return (RevTag) revTag.get();
    }
View Full Code Here


            final Optional<Ref> head = command(RefParse.class).setName(Ref.HEAD).call();
            checkState(!(head.isPresent() && head.get() instanceof SymRef && ((SymRef) head.get())
                    .getTarget().equals(ref.getName())), "Cannot delete the branch you are on");

            UpdateRef updateRef = command(UpdateRef.class).setName(ref.getName()).setDelete(true)
                    .setReason("Delete branch " + ref.getName());
            branchRef = updateRef.call();
            checkState(branchRef.isPresent());
        }
        return branchRef;
    }
View Full Code Here

TOP

Related Classes of org.locationtech.geogig.api.plumbing.UpdateRef

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.