Function listFiles

  • List all the files in the git index or a commit.

    Note: This function is efficient for listing the files in the staging area, but listing all the files in a commit requires recursively walking through the git object store. If you do not require a complete list of every file, better performance can be achieved by using walk and ignoring subdirectories you don't care about.

    Returns

    Resolves successfully with an array of filepaths.

    Example

    // All the files in the previous commit
    let files = await listFiles({ fs, dir: '/tutorial', ref: 'HEAD' })
    console.log(files)
    // All the files in the current staging area
    files = await listFiles({ fs, dir: '/tutorial' })
    console.log(files)

    Parameters

    Returns Promise<string[]>

Generated using TypeDoc