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
Parameter | Type | Description |
---|---|---|
currentWorkingDirectory | string | The working directory. Only used to find the repository root. |
revision | string | (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. |
gitPath | string | (Optional) The path to the Git executable |
Returns:
Map<string, IFileDiffStatus>
A map from the Git file path to the corresponding file change metadata