javagit/src/main/java/edu/nyu/cs/javagit/client/cli/CliGitCheckout.java
private List<String> buildCommand(GitCheckoutOptions options, Ref treeIsh, List<File> paths)
            throws JavaGitException {
        List<String> command = new ArrayList<String>();
        command.add(JavaGitConfiguration.getGitCommand());
        command.add("checkout");
        // Process options
        if (options != null) {
            processOptions(command, options);
        }
        // Process tree-ish
        if (treeIsh != null) {
            command.add(treeIsh.getName());
        }
        // return if no file-paths are provided
        if (paths == null) {
            return command;
        }
        command.add("--");
        for (File file : paths) {
            command.add(file.getName());
        }
        return command;
    }
private List<String> buildCommand(GitCheckoutOptions options, Ref treeIsh, List<File> paths)
            throws JavaGitException {
        List<String> command = new ArrayList<String>();
        command.add(JavaGitConfiguration.getGitCommand());
        command.add("checkout");
        // Process options
        if (options != null) {
            processOptions(command, options);
        }
        // Process tree-ish
        if (treeIsh != null) {
            command.add(treeIsh.getName());
        }
        // return if no file-paths are provided
        if (paths == null) {
            return command;
        }
        command.add("--");
        for (File file : paths) {
            command.add(file.getName());
        }
        return command;
    }
builds a &lt;git-checkout&gt; command in sth <code>List<String></code> format.

@param options <code>GitCheckoutOptions</code> options passed to the &lt;git-checkout&gt; command.
@param treeIsh either a branch type or sha1 type object
@param paths   List of files that are to be checked out
@return Command to be executed as a list of String
@throws JavaGitException