bitfab 0.62.6 → 0.62.8

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.
@@ -6,7 +6,7 @@ import {
6
6
  replayContextReady,
7
7
  runWithReplayContext,
8
8
  unrefTimer
9
- } from "./chunk-5QT34T7B.js";
9
+ } from "./chunk-3SYFXHKU.js";
10
10
  import {
11
11
  runWithCaptureSuppressed,
12
12
  warnOnce
@@ -16,13 +16,6 @@ import {
16
16
  var MAX_FILES = 60;
17
17
  var MAX_FILE_BYTES = 5e5;
18
18
  var MAX_TOTAL_BYTES = 2e6;
19
- var TRUNK_CANDIDATES = [
20
- "origin/HEAD",
21
- "origin/main",
22
- "origin/master",
23
- "main",
24
- "master"
25
- ];
26
19
  var NUL = String.fromCharCode(0);
27
20
  async function resolveAutoCodeChange(label) {
28
21
  if (typeof process === "undefined") {
@@ -82,7 +75,7 @@ async function captureCodeChangeFromGit(cwd, label) {
82
75
  if (!resolved) {
83
76
  return null;
84
77
  }
85
- const { base, fromTrunk } = resolved;
78
+ const { base, against } = resolved;
86
79
  const blobBytes = async (ref, path) => {
87
80
  const out = await git(root, ["cat-file", "-s", `${ref}:${path}`]);
88
81
  const n = out ? Number.parseInt(out.trim(), 10) : Number.NaN;
@@ -150,7 +143,6 @@ async function captureCodeChangeFromGit(cwd, label) {
150
143
  const subject = (await git(root, ["log", "-1", "--format=%s", "HEAD"]))?.trim();
151
144
  const fileWord = files.length === 1 ? "file" : "files";
152
145
  const head = label?.trim() || subject || "Working-tree change";
153
- const against = fromTrunk ? "vs trunk" : "uncommitted (vs HEAD)";
154
146
  return {
155
147
  description: `${head} (${files.length} ${fileWord} changed ${against})`,
156
148
  files
@@ -163,18 +155,9 @@ async function resolveBase(git, root) {
163
155
  const forced = process.env?.BITFAB_CODE_CHANGE_BASE;
164
156
  if (forced && await refExists(git, root, forced)) {
165
157
  const base = (await git(root, ["merge-base", "HEAD", forced]))?.trim() || (await git(root, ["rev-parse", "--verify", forced]))?.trim() || null;
166
- return base ? { base, fromTrunk: true } : null;
167
- }
168
- for (const candidate of TRUNK_CANDIDATES) {
169
- if (!await refExists(git, root, candidate)) {
170
- continue;
171
- }
172
- const mb = (await git(root, ["merge-base", "HEAD", candidate]))?.trim();
173
- if (mb) {
174
- return { base: mb, fromTrunk: true };
175
- }
158
+ return base ? { base, against: `vs ${forced}` } : null;
176
159
  }
177
- return await refExists(git, root, "HEAD") ? { base: "HEAD", fromTrunk: false } : null;
160
+ return await refExists(git, root, "HEAD") ? { base: "HEAD", against: "uncommitted (vs HEAD)" } : null;
178
161
  }
179
162
  async function refExists(git, root, ref) {
180
163
  return await git(root, ["rev-parse", "--verify", `${ref}^{object}`]) !== null;
@@ -1866,4 +1849,4 @@ export {
1866
1849
  sleepForReplayPersistence,
1867
1850
  replay
1868
1851
  };
1869
- //# sourceMappingURL=chunk-C2R3NEPK.js.map
1852
+ //# sourceMappingURL=chunk-P7IHEJZW.js.map