@tricoteuses/senat
Version:
Handle French Sénat's open data
27 lines (26 loc) • 1.44 kB
TypeScript
export declare function initRepo(repositoryDir: string): void;
export declare function commit(repositoryDir: string, message: string): boolean;
export declare function commitAndPush(repositoryDir: string, message: string, remotes?: string[]): number;
export declare function resetAndPull(gitDir: string): boolean;
export declare function clone(gitGroupUrl: string | undefined, gitName: string, workingDir: string): void;
export declare function run(repositoryDir: string, args: string, verbose?: boolean): string;
export declare function test(repositoryDir: string, args: string, verbose?: boolean): boolean;
/**
* Information about a changed file in git
*/
export interface GitChangedFile {
path: string;
status: "A" | "M" | "D" | "R" | "C" | "T" | "U";
}
/**
* Get the list of files that have changed since a specific commit in a git repository.
* @param repositoryDir The directory of the git repository
* @param sinceCommit The commit hash to compare against (e.g., "HEAD~1", "abc123", etc.)
* @param options Options for filtering
* @param options.diffFilter Git diff-filter string (default: "AMR").
* A=Added, M=Modified, D=Deleted, R=Renamed, C=Copied, T=Type changed, U=Unmerged
* @returns A Map of file paths to their git status
*/
export declare function getChangedFilesSinceCommit(repositoryDir: string, sinceCommit: string, options?: {
diffFilter?: string;
}): Map<string, GitChangedFile["status"]>;