@oh-my-pi/pi-natives 18.4.12 → 18.5.1

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/native/vcs.d.ts CHANGED
@@ -81,6 +81,12 @@ export declare function detachGitDir(
81
81
  signal?: AbortSignal,
82
82
  ): Promise<"no-git" | "independent" | "detached">;
83
83
 
84
+ /** Run Git's checkout hook in a new linked worktree and return its output and exit status. */
85
+ export declare function runPostCheckoutHook(
86
+ worktreeRoot: string,
87
+ head: string,
88
+ ): Promise<{ exitCode: number; stdout: Uint8Array; stderr: Uint8Array }>;
89
+
84
90
  /** Join patch fragments, preserving each part's trailing newline. */
85
91
  export declare function joinPatches(parts: string[]): string;
86
92
 
package/native/vcs.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { $ } from "bun";
1
2
  import * as fs from "node:fs";
2
3
  import { loadNative } from "./loader-state.js";
3
4
 
@@ -95,6 +96,19 @@ export function detachGitDir(worktreeRoot, sourceCommonDir, signal) {
95
96
  return api().vcsDetachGitDir(worktreeRoot, sourceCommonDir, signal);
96
97
  }
97
98
 
99
+ /**
100
+ * Run Git's checkout hook in a newly created linked worktree, using the same
101
+ * null old HEAD and branch-switch flag as `git worktree add`.
102
+ */
103
+ export async function runPostCheckoutHook(worktreeRoot, head) {
104
+ const nullOid = "0".repeat(head.length);
105
+ const result = await $`git hook run --ignore-missing post-checkout -- ${nullOid} ${head} 1`
106
+ .cwd(worktreeRoot)
107
+ .quiet()
108
+ .nothrow();
109
+ return { exitCode: result.exitCode, stdout: result.stdout, stderr: result.stderr };
110
+ }
111
+
98
112
  /** Join patch fragments, preserving each part's trailing newline. */
99
113
  export function joinPatches(parts) {
100
114
  return api().vcsJoinPatches(parts);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oh-my-pi/pi-natives",
3
- "version": "18.4.12",
3
+ "version": "18.5.1",
4
4
  "description": "Native Rust bindings for PDF conversion, audio, WebRTC, grep, clipboard, image processing, syntax highlighting, PTY, and shell operations via N-API",
5
5
  "type": "module",
6
6
  "homepage": "https://omp.sh",
@@ -114,11 +114,11 @@
114
114
  }
115
115
  },
116
116
  "optionalDependencies": {
117
- "@oh-my-pi/pi-natives-linux-x64": "18.4.12",
118
- "@oh-my-pi/pi-natives-linux-arm64": "18.4.12",
119
- "@oh-my-pi/pi-natives-darwin-x64": "18.4.12",
120
- "@oh-my-pi/pi-natives-darwin-arm64": "18.4.12",
121
- "@oh-my-pi/pi-natives-win32-x64": "18.4.12",
122
- "@oh-my-pi/pi-natives-win32-arm64": "18.4.12"
117
+ "@oh-my-pi/pi-natives-linux-x64": "18.5.1",
118
+ "@oh-my-pi/pi-natives-linux-arm64": "18.5.1",
119
+ "@oh-my-pi/pi-natives-darwin-x64": "18.5.1",
120
+ "@oh-my-pi/pi-natives-darwin-arm64": "18.5.1",
121
+ "@oh-my-pi/pi-natives-win32-x64": "18.5.1",
122
+ "@oh-my-pi/pi-natives-win32-arm64": "18.5.1"
123
123
  }
124
124
  }