Skip to content

Commit c3fd4c6

Browse files
committed
Reduce API changes, add documentation to the added method
1 parent eafd8dc commit c3fd4c6

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

src/commandsAndMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,7 @@ export function addFileBrowserContextMenu(
852852
const items = getSelectedBrowserItems();
853853
const statuses = new Set<Git.Status>(
854854
items
855-
.map(item => model.getFileStatus(item.path))
855+
.map(item => model.getFile(item.path)?.status)
856856
.filter(status => typeof status !== 'undefined')
857857
);
858858

src/model.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,13 @@ export class GitExtension implements IGitExtension {
242242
await this.refreshStatus();
243243
}
244244

245-
getFileStatus(path: string): Git.Status {
246-
return this.getFile(path)?.status;
247-
}
248-
245+
/**
246+
* Match files status information based on a provided file path.
247+
*
248+
* If the file is tracked and has no changes, undefined will be returned
249+
*
250+
* @param path the file path relative to the server root
251+
*/
249252
getFile(path: string): Git.IStatusFile {
250253
const matchingFiles = this._status.files.filter(status => {
251254
return this.getRelativeFilePath(status.to) === path;

src/tokens.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -249,16 +249,13 @@ export interface IGitExtension extends IDisposable {
249249
ensureGitignore(): Promise<void>;
250250

251251
/**
252+
* Match files status information based on a provided file path.
252253
*
253-
* @param path
254-
*/
255-
getFile(path: string): Git.IStatusFile;
256-
257-
/**
254+
* If the file is tracked and has no changes, undefined will be returned
258255
*
259-
* @param path
256+
* @param path the file path relative to the server root
260257
*/
261-
getFileStatus(path: string): Git.Status;
258+
getFile(path: string): Git.IStatusFile;
262259

263260
/**
264261
* Get current mark of file named fname
@@ -637,7 +634,7 @@ export namespace Git {
637634

638635
/** Interface for changed_files request result
639636
* lists the names of files that have differences between two commits
640-
* or beween two branches, or that were changed by a single commit
637+
* or between two branches, or that were changed by a single commit
641638
*/
642639
export interface IChangedFilesResult {
643640
code: number;

0 commit comments

Comments
 (0)