Skip to content

Commit 639e650

Browse files
committed
update extension.ts
1 parent 460542a commit 639e650

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/extension.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,19 @@ function _validateFoundRepos(git: API) {
3131
* Run autofill against one of multiples in the workspace.
3232
*
3333
* This is a rare flow.
34+
*
35+
* @param sourceControl Of type `vscode.SourceControl` with public `.rootUri`
36+
* and private `.rootUri`.
3437
*/
35-
async function _handleRepos(git: API, uri: any) {
38+
async function _handleRepos(git: API, sourceControl: any) {
3639
// FIXME: Unfortunately this seems to only pick up the first repo and not find
3740
// second, etc.
3841
const selectedRepository = git.repositories.find(repository => {
39-
console.debug({ uri, _rootUri: uri._rootUri });
40-
if (!uri._rootUri) {
42+
const uri = sourceControl._rootUri;
43+
if (!uri) {
4144
console.warn("_rootUri not set");
4245
}
43-
return repository.rootUri.path === uri._rootUri.path;
46+
return repository.rootUri.path === uri.path;
4447
});
4548

4649
if (selectedRepository) {
@@ -92,6 +95,7 @@ export function activate(context: vscode.ExtensionContext) {
9295
vscode.window.showInformationMessage(
9396
`Generating commit message because file was saved - ${e.fileName}`
9497
);
98+
// TODO: Handle multiple repos by passing `sourceControl` or `uri`.
9599
_chooseRepoForAutofill();
96100
})
97101
);

0 commit comments

Comments
 (0)