Skip to content

Commit 436ef26

Browse files
committed
Update the getFile to return first match
without warning if there are more matches
1 parent ef78677 commit 436ef26

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/model.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -250,16 +250,9 @@ export class GitExtension implements IGitExtension {
250250
* @param path the file path relative to the server root
251251
*/
252252
getFile(path: string): Git.IStatusFile {
253-
const matchingFiles = this._status.files.find(status => {
253+
return this._status.files.find(status => {
254254
return this.getRelativeFilePath(status.to) === path;
255255
});
256-
if (matchingFiles.length === 0) {
257-
return;
258-
}
259-
if (matchingFiles.length > 1) {
260-
console.warn('More than one file matching given path', path);
261-
}
262-
return matchingFiles[0];
263256
}
264257

265258
/**

0 commit comments

Comments
 (0)