From bf28f8270d9e5d9ab3906afec9e1e06cab906e5c Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Thu, 20 Feb 2025 15:03:50 -0500 Subject: [PATCH] GitCommandManager: add a function to get a file's contents at a specific revision --- src/git-command-manager.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index 9be35e41..303c4b53 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -278,6 +278,12 @@ export class GitCommandManager { return output.stdout.trim() } + async showFileAtRef(ref: string, path: string): Promise { + const args = ['show', `${ref}:${path}`] + const output = await this.exec(args) + return output.stdout.trim() + } + async stashPush(options?: string[]): Promise { const args = ['stash', 'push'] if (options) {