@aspruyt/xfg 3.10.1 → 3.10.3
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.
|
@@ -163,15 +163,27 @@ function matchByType(current, desired) {
|
|
|
163
163
|
currentByType.set(type, item);
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
|
+
const desiredTypes = new Set();
|
|
166
167
|
const result = [];
|
|
167
168
|
for (const desiredItem of desired) {
|
|
168
169
|
const type = desiredItem.type;
|
|
170
|
+
desiredTypes.add(type);
|
|
169
171
|
const currentItem = currentByType.get(type);
|
|
170
172
|
if (currentItem) {
|
|
171
173
|
result.push(projectToDesiredShape(currentItem, desiredItem));
|
|
172
174
|
}
|
|
173
175
|
// If no match in current, skip — diff handles additions
|
|
174
176
|
}
|
|
177
|
+
// Append current items not in desired — these are removals that
|
|
178
|
+
// deepEqual must detect (length mismatch). Fixes #549.
|
|
179
|
+
for (const item of current) {
|
|
180
|
+
if (isPlainObject(item)) {
|
|
181
|
+
const type = item.type;
|
|
182
|
+
if (type && !desiredTypes.has(type)) {
|
|
183
|
+
result.push(item);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
175
187
|
return result;
|
|
176
188
|
}
|
|
177
189
|
function matchByIndex(current, desired) {
|
|
@@ -130,7 +130,7 @@ export class AuthenticatedGitOps {
|
|
|
130
130
|
async fetchBranch(branchName) {
|
|
131
131
|
// Remote URL already has auth from clone
|
|
132
132
|
const safeBranch = escapeShellArg(branchName);
|
|
133
|
-
await this.execWithRetry(`git fetch origin
|
|
133
|
+
await this.execWithRetry(`git fetch origin +${safeBranch}:refs/remotes/origin/${safeBranch}`);
|
|
134
134
|
}
|
|
135
135
|
// ============================================================
|
|
136
136
|
// Local operations - delegate directly to GitOps
|
|
@@ -115,7 +115,7 @@ export class GraphQLCommitStrategy {
|
|
|
115
115
|
await gitOps.fetchBranch(branchName);
|
|
116
116
|
}
|
|
117
117
|
else {
|
|
118
|
-
await this.executor.exec(`git fetch origin
|
|
118
|
+
await this.executor.exec(`git fetch origin +${safeBranch}:refs/remotes/origin/${safeBranch}`, workDir);
|
|
119
119
|
}
|
|
120
120
|
// Get the remote HEAD SHA for this branch (not local HEAD)
|
|
121
121
|
const headSha = await this.executor.exec(`git rev-parse origin/${safeBranch}`, workDir);
|
package/package.json
CHANGED