(repoPath: string)
| 394 | * both probes run. |
| 395 | */ |
| 396 | export function derivePathOnlyHashLegacyId(repoPath: string): string { |
| 397 | const pathHash = createHash("sha1").update(repoPath).digest("hex").slice(0, 8); |
| 398 | const remote = canonicalizeRemote(originUrl()); |
| 399 | if (remote) { |
| 400 | const segs = remote.split("/").filter(Boolean); |
| 401 | const slugSource = segs.slice(-2).join("-"); |
| 402 | return constrainSourceId("gstack-code", `${slugSource}-${pathHash}`); |
| 403 | } |
| 404 | const base = repoPath.split("/").pop() || "repo"; |
| 405 | return constrainSourceId("gstack-code", `${base}-${pathHash}`); |
| 406 | } |
| 407 | |
| 408 | /** |
| 409 | * Feature-check whether the installed gbrain CLI ships `sources rename <old> <new>`. |
no test coverage detected