Skip to content

updateAll

Update all index entries to match the working directory.

This scans the existing index entries and synchronizes them with the working directory, deleting them if the corresponding working directory file no longer exists otherwise updating the information (including adding the latest version of file to the ODB if needed).

Signature

ts
class Index {
  updateAll(pathspecs: string[], options?: IndexUpdateAllOptions): void;
}

Parameters

  • pathspecsrequired · string[]

    A List of file names of shell glob patterns that will matched against files in the repository's working directory

  • optionsnull | IndexUpdateAllOptions

    Options for update all matching index entry.

    • onMatch(args: IndexOnMatchCallbackArgs) => number

      If you provide a callback function, it will be invoked on each matching item in the index immediately before it is updated (either refreshed or removed depending on working directory state). Return 0 to proceed with updating the item, > 0 to skip the item, and < 0 to abort the scan.

Errors

  • Error

    This method will fail in bare index instances.

Released under the MIT License.