@ricsam/r5d-worker 0.0.64 → 0.0.65

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/dist/cjs/main.cjs CHANGED
@@ -807,6 +807,19 @@ function fallbackInternalRemoteUrl(baseUrl, projectId) {
807
807
  }
808
808
  function visibleCheckoutRemoteFor(input) {
809
809
  const canonicalCheckout = input.manifest?.canonicalCheckouts?.find((checkout) => checkout.branchName === input.branchName);
810
+ if (!canonicalCheckout && input.manifest) {
811
+ if (!input.manifest.repoHttpUrl) {
812
+ throw new Error(`Project ${input.projectId} has no connected repository; connect one before opening its checkouts`);
813
+ }
814
+ return {
815
+ remoteUrl: input.manifest.repoHttpUrl,
816
+ authHeader: input.manifest.repoAuthHeader ?? null,
817
+ persistAuth: true,
818
+ reconcileExistingOrigin: true,
819
+ requireRemoteBranch: false,
820
+ requiredBaseCommit: null
821
+ };
822
+ }
810
823
  return {
811
824
  remoteUrl: fallbackInternalRemoteUrl(input.baseUrl, input.projectId),
812
825
  authHeader: `Authorization: Bearer ${input.token}`,
@@ -1149,6 +1162,9 @@ function ensureVisibleGitCheckout(input) {
1149
1162
  if (input.reconcileExistingOrigin) {
1150
1163
  ensureOriginRemote(branchPath, input.remoteUrl);
1151
1164
  }
1165
+ if (!input.requireRemoteBranch) {
1166
+ tryGit(visibleCheckoutFetchArgs("origin", "--prune"), { cwd: branchPath, auth: input.remoteAuth });
1167
+ }
1152
1168
  if (input.requireRemoteBranch && !tryGit(["show-ref", "--verify", "--quiet", `refs/remotes/origin/${input.branchName}`], { cwd: branchPath })) {
1153
1169
  throw new Error(`Existing checkout for ${input.branchName} does not contain its canonical remote branch`);
1154
1170
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@ricsam/r5d-worker",
3
- "version": "0.0.64",
3
+ "version": "0.0.65",
4
4
  "type": "commonjs"
5
5
  }
package/dist/mjs/main.mjs CHANGED
@@ -778,6 +778,19 @@ function fallbackInternalRemoteUrl(baseUrl, projectId) {
778
778
  }
779
779
  function visibleCheckoutRemoteFor(input) {
780
780
  const canonicalCheckout = input.manifest?.canonicalCheckouts?.find((checkout) => checkout.branchName === input.branchName);
781
+ if (!canonicalCheckout && input.manifest) {
782
+ if (!input.manifest.repoHttpUrl) {
783
+ throw new Error(`Project ${input.projectId} has no connected repository; connect one before opening its checkouts`);
784
+ }
785
+ return {
786
+ remoteUrl: input.manifest.repoHttpUrl,
787
+ authHeader: input.manifest.repoAuthHeader ?? null,
788
+ persistAuth: true,
789
+ reconcileExistingOrigin: true,
790
+ requireRemoteBranch: false,
791
+ requiredBaseCommit: null
792
+ };
793
+ }
781
794
  return {
782
795
  remoteUrl: fallbackInternalRemoteUrl(input.baseUrl, input.projectId),
783
796
  authHeader: `Authorization: Bearer ${input.token}`,
@@ -1120,6 +1133,9 @@ function ensureVisibleGitCheckout(input) {
1120
1133
  if (input.reconcileExistingOrigin) {
1121
1134
  ensureOriginRemote(branchPath, input.remoteUrl);
1122
1135
  }
1136
+ if (!input.requireRemoteBranch) {
1137
+ tryGit(visibleCheckoutFetchArgs("origin", "--prune"), { cwd: branchPath, auth: input.remoteAuth });
1138
+ }
1123
1139
  if (input.requireRemoteBranch && !tryGit(["show-ref", "--verify", "--quiet", `refs/remotes/origin/${input.branchName}`], { cwd: branchPath })) {
1124
1140
  throw new Error(`Existing checkout for ${input.branchName} does not contain its canonical remote branch`);
1125
1141
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@ricsam/r5d-worker",
3
- "version": "0.0.64",
3
+ "version": "0.0.65",
4
4
  "type": "module"
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ricsam/r5d-worker",
3
- "version": "0.0.64",
3
+ "version": "0.0.65",
4
4
  "type": "module",
5
5
  "main": "./dist/cjs/main.cjs",
6
6
  "module": "./dist/mjs/main.mjs",