private String resolveCommitter() { if (committerName != null) { return committerName; } final String key = "user.name"; Optional<String> name = command(ConfigGet.class).setName(key).call(); checkState(name.isPresent(), "%s not found in config. Use geogig config [--global] %s <your name> to configure it.", key, key); return name.get(); }
@Nullable private String resolveCommitterEmail() { if (committerEmail != null) { return committerEmail.orNull(); } final String key = "user.email"; Optional<String> email = command(ConfigGet.class).setName(key).call(); checkState(email.isPresent(), "%s not found in config. Use geogig config [--global] %s <your email> to configure it.", key, key); return email.get(); }
@Nullable private String resolveCommitterEmail() { if (committerEmail != null) { return committerEmail.orNull(); } final String emailkey = "user.email"; String email = getClientData(emailkey, String.class) .or(command(ConfigGet.class).setName(emailkey).call()).orNull(); checkState(email != null, "%s not found in config. Use geogig config [--global] %s <your email> to configure it.", emailkey, emailkey); return email; }
private String resolveCommitter() { if (committerName != null) { return committerName; } final String namekey = "user.name"; String name = getClientData(namekey, String.class) .or(command(ConfigGet.class).setName(namekey).call()).orNull(); checkState(name != null, "%s not found in config. Use geogig config [--global] %s <your name> to configure it.", namekey, namekey); return name; }
if (all) { writeTreeProgress = 50f; AddOp op = command(AddOp.class); for (String st : pathFilters) { op.addPattern(st); final Optional<Ref> currHead = command(RefParse.class).setName(Ref.HEAD).call(); checkState(currHead.isPresent(), "Repository has no HEAD, can't commit"); final Ref headRef = currHead.get(); if (!currHeadCommitId.isNull()) { if (amend) { RevCommit headCommit = command(RevObjectParse.class).setObjectId(currHeadCommitId) .call(RevCommit.class).get(); parents.addAll(headCommit.getParentIds()); RevTree commitTree = command(RevObjectParse.class) .setObjectId(headCommit.getTreeId()).call(RevTree.class).get(); oldRoot = Suppliers.ofInstance(commitTree); final Optional<Ref> mergeHead = command(RefParse.class).setName(Ref.MERGE_HEAD).call(); if (mergeHead.isPresent()) { ObjectId mergeCommitId = mergeHead.get().getObjectId(); commitMessage = command(ReadMergeCommitMessageOp.class).call(); WriteTree2 writeTree = command(WriteTree2.class); writeTree.setOldRoot(oldRoot).setProgressListener(subProgress(writeTreeProgress)); if (!pathFilters.isEmpty()) {
if (all) { writeTreeProgress = 50f; AddOp op = command(AddOp.class); for (String st : pathFilters) { op.addPattern(st); final Optional<Ref> currHead = command(RefParse.class).setName(Ref.HEAD).call(); checkState(currHead.isPresent(), "Repository has no HEAD, can't commit"); final Ref headRef = currHead.get(); if (!currHeadCommitId.isNull()) { if (amend) { RevCommit headCommit = command(RevObjectParse.class).setObjectId(currHeadCommitId) .call(RevCommit.class).get(); parents.addAll(headCommit.getParentIds()); RevTree commitTree = command(RevObjectParse.class) .setObjectId(headCommit.getTreeId()).call(RevTree.class).get(); oldRoot = Suppliers.ofInstance(commitTree); final Optional<Ref> mergeHead = command(RefParse.class).setName(Ref.MERGE_HEAD).call(); if (mergeHead.isPresent()) { ObjectId mergeCommitId = mergeHead.get().getObjectId(); commitMessage = command(ReadMergeCommitMessageOp.class).call(); WriteTree2 writeTree = command(WriteTree2.class); writeTree.setOldRoot(oldRoot).setProgressListener(subProgress(writeTreeProgress)); if (!pathFilters.isEmpty()) {