class GitDiffRunner {

    static String[] buildDiffCommand(RevisionScope<ObjectId> revisionScope) {
        ObjectId fromRevision = revisionScope.getFrom();
        ObjectId toRevision = revisionScope.getTo();

        List<String> command = new ArrayList<>();

        command.add("git");
        command.add("diff");
        command.add("-U1");
        command.add(toRevision.equals(fromRevision)? fromRevision.getName() + '~' : fromRevision.getName());
        if (!toRevision.equals(ObjectId.zeroId())) {
            command.add(toRevision.getName());
        }

        addFileTypeFilters(command);

        return command.toArray(new String[0]);
    }

    private  GitDiffRunner();

}