src/utils/commit.js
function prepare(repoState, opts) {
    const workingState = repoState.getCurrentState();
    const changes = workingState.getChanges();

    // Is this an empty commit ?
    opts.empty = workingState.isClean();

    // Parent SHA
    opts.parents = new Immutable.List([
        workingState.getHead()
    ]);

    // Get merged tree (with applied changes)
    opts.treeEntries = WorkingUtils.getMergedTreeEntries(workingState);

    // Create map of blobs that needs to be created
    opts.blobs = changes.filter((change) => {
        return !change.hasSha();
    }).map((change) => {
        return change.getContent();
    });

    return CommitBuilder.create(opts);
}
function prepare(repoState, opts) {
    const workingState = repoState.getCurrentState();
    const changes = workingState.getChanges();

    // Is this an empty commit ?
    opts.empty = workingState.isClean();

    // Parent SHA
    opts.parents = new Immutable.List([
        workingState.getHead()
    ]);

    // Get merged tree (with applied changes)
    opts.treeEntries = WorkingUtils.getMergedTreeEntries(workingState);

    // Create map of blobs that needs to be created
    opts.blobs = changes.filter((change) => {
        return !change.hasSha();
    }).map((change) => {
        return change.getContent();
    });

    return CommitBuilder.create(opts);
}
Create a commit builder from the changes on current branch
@param {RepositoryState}
@param {Author} opts.author
@param {String} [opts.message]
@return {CommitBuilder}