hillclimb 0.8.9 → 0.8.10
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/main.js +19 -4
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -14711,9 +14711,11 @@ function createGitError(args, err, timeoutMs = GIT_COMMAND_TIMEOUT_MS) {
|
|
|
14711
14711
|
const message = isTimeout ? `${command} timed out after ${timeoutMs}ms` : failure.code === "ENOBUFS" ? `${command} output exceeded the ${formatSize(failure.maxBufferBytes ?? EXEC_OPTS.maxBuffer)} limit` : formatGitFailure(command, failure, err);
|
|
14712
14712
|
const wrapped = new Error(message);
|
|
14713
14713
|
wrapped.isGitTimeout = isTimeout;
|
|
14714
|
-
wrapped.gitExitStatus = failure.status;
|
|
14714
|
+
wrapped.gitExitStatus = failure.code || failure.signal ? void 0 : failure.status;
|
|
14715
14715
|
const stderr = outputToString(failure.stderr);
|
|
14716
14716
|
wrapped.gitStderr = stderr ? truncateOutput(stderr) : void 0;
|
|
14717
|
+
const stdout = outputToString(failure.stdout);
|
|
14718
|
+
wrapped.gitStdout = stdout ? truncateOutput(stdout) : void 0;
|
|
14717
14719
|
wrapped.isGitMissingObject = !isTimeout && failure.code !== "ENOBUFS" && matchesMissingObject(stderr);
|
|
14718
14720
|
return wrapped;
|
|
14719
14721
|
}
|
|
@@ -14752,6 +14754,19 @@ function isGitRepo(dir) {
|
|
|
14752
14754
|
return false;
|
|
14753
14755
|
}
|
|
14754
14756
|
}
|
|
14757
|
+
function stashRetryReason(failure) {
|
|
14758
|
+
const status = failure.gitExitStatus;
|
|
14759
|
+
if (status !== 1 && status !== 128) return null;
|
|
14760
|
+
if (/Unable to create [^\n]*index\.lock[^\n]*: File exists/.test(
|
|
14761
|
+
failure.gitStderr ?? ""
|
|
14762
|
+
)) {
|
|
14763
|
+
return "index-lock-contention";
|
|
14764
|
+
}
|
|
14765
|
+
if (status === 1 && !failure.gitStderr && !failure.gitStdout) {
|
|
14766
|
+
return "empty-stash-failure";
|
|
14767
|
+
}
|
|
14768
|
+
return null;
|
|
14769
|
+
}
|
|
14755
14770
|
function captureWorkingCommitSha(repoRoot) {
|
|
14756
14771
|
for (let attempt = 1; ; attempt++) {
|
|
14757
14772
|
let sha;
|
|
@@ -14778,11 +14793,11 @@ function captureWorkingCommitSha(repoRoot) {
|
|
|
14778
14793
|
const tree = git(repoRoot, ["write-tree"]);
|
|
14779
14794
|
return git(repoRoot, ["commit-tree", tree, "-m", "empty baseline"]);
|
|
14780
14795
|
}
|
|
14781
|
-
|
|
14782
|
-
|
|
14796
|
+
const retryReason = stashRetryReason(failure);
|
|
14797
|
+
if (!retryReason || attempt >= 5) throw err;
|
|
14783
14798
|
appendLog(
|
|
14784
14799
|
"warn",
|
|
14785
|
-
`git-traces: retrying stash create after index lock contention (repo=${repoRoot}, attempt=${attempt}, maxAttempts=5): ${failure.message}`
|
|
14800
|
+
`git-traces: retrying stash create after ${retryReason === "index-lock-contention" ? "index lock contention" : "empty Git failure (possible index contention)"} (repo=${repoRoot}, attempt=${attempt}, maxAttempts=5, reason=${retryReason}): ${failure.message}`
|
|
14786
14801
|
);
|
|
14787
14802
|
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 250);
|
|
14788
14803
|
continue;
|