@@ -0,0 +1,1354 @@
+package ee.shy.core;%0A%0Aimport ee.shy.io.Jsonable;%0Aimport ee.shy.io.Required;%0Aimport ee.shy.storage.Hash;%0A%0Apublic class Current implements Jsonable %7B%0A    public enum State %7B%0A        BRANCH(true),%0A        TAG(false),%0A        COMMIT(false),%0A        ;%0A%0A        private final boolean committable;%0A%0A        State(boolean committable) %7B%0A            this.committable = committable;%0A        %7D%0A%0A        public boolean isCommittable() %7B%0A            return committable;%0A        %7D%0A    %7D%0A%0A    @Required%0A    private final Hash commit;%0A%0A    private final String branch;%0A    private final String tag;%0A%0A    public Current(Hash commit, String branch, String tag) %7B%0A        this.commit = commit;%0A        this.branch = branch;%0A        this.tag = tag;%0A        // TODO: 15.04.16 check state%0A    %7D%0A%0A    public State getState() %7B%0A        if (commit == null)%0A            throw new IllegalStateException(%22current must have a commit%22);%0A        else if (branch != null && tag != null)%0A            throw new IllegalStateException(%22current can't be a branch and a tag simultaneously%22);%0A        else if (branch != null && tag == null)%0A            return State.BRANCH;%0A        else if (branch == null && tag != null)%0A            return State.TAG;%0A        else%0A            return State.COMMIT;%0A    %7D%0A%0A    public boolean isCommittable() %7B%0A        return getState().isCommittable();%0A    %7D%0A%7D%0A

Create class for Current commit state