RoadmapShopEvents
Skip to main content

Home > @rushstack/package-deps-hash > getRepoChanges

getRepoChanges() function

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Find all changed files tracked by Git, their current hashes, and the nature of the change. Only useful if all changes are staged or committed.

Signature:

export declare function getRepoChanges(currentWorkingDirectory: string, revision?: string, gitPath?: string): Map<string, IFileDiffStatus>;

Parameters

ParameterTypeDescription
currentWorkingDirectorystringThe working directory. Only used to find the repository root.
revisionstring(Optional) The Git revision specifier to detect changes relative to. Defaults to HEAD (i.e. will compare staged vs. committed) If comparing against a different branch, call git merge-base first to find the target commit.
gitPathstring(Optional) The path to the Git executable

Returns:

Map<string, IFileDiffStatus>

A map from the Git file path to the corresponding file change metadata