UNPKG

@synstack/git

Version:
37 lines (34 loc) 1.08 kB
/** * Lists all files in a Git repository, including tracked, modified, and untracked files. * Respects .gitignore rules. * * @param cwd - The working directory to execute the git command from * @returns A sorted array of file paths * * @example * ```ts * const files = await ls('./my-repo') * // ['index.ts', 'lib.ts', ...] * ``` */ declare function ls(cwd?: string): Promise<string[]>; /** * Shows the details of a specific Git commit, including the commit message and changes. * * @param commitId - The hash of the commit to show * @param cwd - The working directory to execute the git command from * @returns The commit details as a string * * @example * ```ts * const commit = await show('449b7730436026243936a0a2f37c6d3474fcad3b') * // Returns commit message and changes * ``` */ declare function show(commitId: string, cwd?: string): Promise<string>; declare const git_lib_ls: typeof ls; declare const git_lib_show: typeof show; declare namespace git_lib { export { git_lib_ls as ls, git_lib_show as show }; } export { git_lib as git, ls, show };