Skip to content

Commit 8f0ee9b

Browse files
committed
Allows file parameters to accept URIs
1 parent 7c7c4b6 commit 8f0ee9b

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

src/git/actions/commit.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ export async function openAllChangesWithWorkingIndividually(
334334
}
335335

336336
export async function openChanges(
337-
file: string | GitFile,
337+
file: string | Uri | GitFile,
338338
commit: GitCommit,
339339
options?: TextDocumentShowOptions,
340340
): Promise<void>;
@@ -349,13 +349,13 @@ export async function openChanges(
349349
options?: TextDocumentShowOptions & { lhsTitle?: string; rhsTitle?: string },
350350
): Promise<void>;
351351
export async function openChanges(
352-
file: string | GitFile,
352+
file: string | Uri | GitFile,
353353
commitOrRefs: GitCommit | RefRange,
354354
options?: TextDocumentShowOptions & { lhsTitle?: string; rhsTitle?: string },
355355
): Promise<void> {
356356
const hasCommit = isCommit(commitOrRefs);
357357

358-
if (typeof file === 'string') {
358+
if (typeof file === 'string' || file instanceof Uri) {
359359
if (!hasCommit) throw new Error('Invalid arguments');
360360

361361
const f = await commitOrRefs.findFile(file);

src/git/models/commit.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -333,16 +333,6 @@ export class GitCommit implements GitRevisionReference {
333333
this._stats = { ...this._stats, files: changedFiles, additions: additions, deletions: deletions };
334334
}
335335

336-
async findFile(
337-
path: string,
338-
staged?: boolean,
339-
options?: { include?: { stats?: boolean } },
340-
): Promise<GitFileChange | undefined>;
341-
async findFile(
342-
uri: Uri,
343-
staged?: boolean,
344-
options?: { include?: { stats?: boolean } },
345-
): Promise<GitFileChange | undefined>;
346336
async findFile(
347337
pathOrUri: string | Uri,
348338
staged?: boolean,

0 commit comments

Comments
 (0)