We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d6afbb6 commit e3ba14eCopy full SHA for e3ba14e
client/src/addon_manager/models/addon.ts
@@ -127,8 +127,20 @@ export class Addon {
127
}
128
129
public async getDefaultBranch() {
130
- const modulePath = vscode.Uri.joinPath(this.uri, "module");
+ // Get branch from .gitmodules if specified
131
+ const targetBranch = await git.raw(
132
+ "config",
133
+ "-f",
134
+ ".gitmodules",
135
+ "--get",
136
+ `submodule.addons/${this.name}/module.branch`
137
+ );
138
+ if (targetBranch) {
139
+ return targetBranch;
140
+ }
141
142
+ // Fetch default branch from remote
143
+ const modulePath = vscode.Uri.joinPath(this.uri, "module");
144
const result = (await git
145
.cwd({ path: modulePath.fsPath, root: false })
146
.remote(["show", "origin"])) as string;
0 commit comments