@bitfab/sdk 0.36.10 → 0.36.11

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.
@@ -98,7 +98,7 @@ async function captureCodeChangeFromGit(cwd, label) {
98
98
  const tracked = await git(root, [
99
99
  "diff",
100
100
  "--name-status",
101
- "--no-renames",
101
+ "--find-renames",
102
102
  "-z",
103
103
  base,
104
104
  "--",
@@ -114,23 +114,23 @@ async function captureCodeChangeFromGit(cwd, label) {
114
114
  ]);
115
115
  const entries = [
116
116
  ...parseNameStatusZ(tracked ?? ""),
117
- ...(untracked ?? "").split(NUL).filter((p) => p.length > 0).map((path) => ({ status: "A", path }))
117
+ ...(untracked ?? "").split(NUL).filter((p) => p.length > 0).map((path) => ({ status: "A", beforePath: path, path }))
118
118
  ];
119
119
  if (entries.length === 0) {
120
120
  return null;
121
121
  }
122
122
  const files = [];
123
123
  let totalBytes = 0;
124
- for (const { status, path } of entries) {
124
+ for (const { status, beforePath, path } of entries) {
125
125
  if (files.length >= MAX_FILES) {
126
126
  break;
127
127
  }
128
- const beforeBytes = status === "A" ? 0 : await blobBytes(base, path);
128
+ const beforeBytes = status === "A" ? 0 : await blobBytes(base, beforePath);
129
129
  const afterBytes = status === "D" ? 0 : await workingBytes(path);
130
130
  if (beforeBytes > MAX_FILE_BYTES || afterBytes > MAX_FILE_BYTES) {
131
131
  continue;
132
132
  }
133
- const before = (status === "A" ? "" : await git(root, ["show", `${base}:${path}`]) ?? "").replace(/\r\n/g, "\n");
133
+ const before = (status === "A" ? "" : await git(root, ["show", `${base}:${beforePath}`]) ?? "").replace(/\r\n/g, "\n");
134
134
  const after = (status === "D" ? "" : await readWorkingFile(readFile, root, path)).replace(/\r\n/g, "\n");
135
135
  if (before === after) {
136
136
  continue;
@@ -188,8 +188,18 @@ async function readWorkingFile(readFile, root, path) {
188
188
  function parseNameStatusZ(raw) {
189
189
  const parts = raw.split(NUL).filter((p) => p.length > 0);
190
190
  const out = [];
191
- for (let i = 0; i + 1 < parts.length; i += 2) {
192
- out.push({ status: parts[i].charAt(0), path: parts[i + 1] });
191
+ let i = 0;
192
+ while (i + 1 < parts.length) {
193
+ const status = parts[i].charAt(0);
194
+ i += 1;
195
+ const beforePath = parts[i];
196
+ i += 1;
197
+ if ((status === "R" || status === "C") && i < parts.length) {
198
+ out.push({ status, beforePath, path: parts[i] });
199
+ i += 1;
200
+ } else {
201
+ out.push({ status, beforePath, path: beforePath });
202
+ }
193
203
  }
194
204
  return out;
195
205
  }
@@ -304,7 +314,7 @@ function encodeRequestBody(body) {
304
314
  }
305
315
 
306
316
  // src/version.generated.ts
307
- var __version__ = "0.36.10";
317
+ var __version__ = "0.36.11";
308
318
 
309
319
  // src/constants.ts
310
320
  var DEFAULT_SERVICE_URL = "https://bitfab.ai";
@@ -2923,4 +2933,4 @@ export {
2923
2933
  sleepForReplayPersistence,
2924
2934
  replay
2925
2935
  };
2926
- //# sourceMappingURL=chunk-AAMRJGZJ.js.map
2936
+ //# sourceMappingURL=chunk-EKOAKLZC.js.map