repository-provider 35.8.2 → 35.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/multi-group-provider.mjs +25 -5
package/package.json
CHANGED
|
@@ -10,7 +10,6 @@ import { RepositoryGroup } from "./repository-group.mjs";
|
|
|
10
10
|
*
|
|
11
11
|
*/
|
|
12
12
|
export class MultiGroupProvider extends BaseProvider {
|
|
13
|
-
|
|
14
13
|
#repositoryGroups = new Map();
|
|
15
14
|
|
|
16
15
|
/**
|
|
@@ -47,7 +46,7 @@ export class MultiGroupProvider extends BaseProvider {
|
|
|
47
46
|
if (rg !== undefined) {
|
|
48
47
|
const r = await rg.repository(repository);
|
|
49
48
|
if (r !== undefined) {
|
|
50
|
-
return r.branch(
|
|
49
|
+
return r.branch(branch || r.defaultBranchName);
|
|
51
50
|
}
|
|
52
51
|
}
|
|
53
52
|
}
|
|
@@ -64,7 +63,12 @@ export class MultiGroupProvider extends BaseProvider {
|
|
|
64
63
|
|
|
65
64
|
if (this.supportsBase(base)) {
|
|
66
65
|
await this.initializeRepositories();
|
|
67
|
-
return this.#repositoryGroups.get(
|
|
66
|
+
return this.#repositoryGroups.get(
|
|
67
|
+
this.normalizeGroupName(
|
|
68
|
+
stripBaseName(name, this.provider.repositoryBases),
|
|
69
|
+
true
|
|
70
|
+
)
|
|
71
|
+
);
|
|
68
72
|
}
|
|
69
73
|
}
|
|
70
74
|
|
|
@@ -105,10 +109,26 @@ export class MultiGroupProvider extends BaseProvider {
|
|
|
105
109
|
*/
|
|
106
110
|
addRepositoryGroup(name, options) {
|
|
107
111
|
// @ts-ignore
|
|
108
|
-
return
|
|
112
|
+
return (
|
|
113
|
+
this.#repositoryGroups.get(this.normalizeGroupName(name, true)) ||
|
|
114
|
+
new (this.repositoryGroupClassFor(name, options))(this, name, options)
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Retrieve class suitable to hold repository group for name and options
|
|
120
|
+
* @param {string} name
|
|
121
|
+
* @param {Object} options
|
|
122
|
+
* @returns {Function}
|
|
123
|
+
*/
|
|
124
|
+
repositoryGroupClassFor(name, options) {
|
|
125
|
+
return this.repositoryGroupClass;
|
|
109
126
|
}
|
|
110
127
|
|
|
111
128
|
_addRepositoryGroup(repositoryGroup) {
|
|
112
|
-
this.#repositoryGroups.set(
|
|
129
|
+
this.#repositoryGroups.set(
|
|
130
|
+
this.normalizeGroupName(repositoryGroup.name, true),
|
|
131
|
+
repositoryGroup
|
|
132
|
+
);
|
|
113
133
|
}
|
|
114
134
|
}
|