{"record":{"id":"ad6f6e26c6cbc678","repo":"paperclipai/paperclip","slug":"ref-is-only-supported-for-github-import-sources","errorCode":null,"errorMessage":"--ref is only supported for GitHub import sources.","messagePattern":"--ref is only supported for GitHub import sources\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/client/company.ts","lineNumber":1715,"sourceCode":"          let sourcePayload:\n            | { type: \"inline\"; rootPath?: string | null; files: Record<string, CompanyPortabilityFileEntry> }\n            | { type: \"github\"; url: string };\n          let chunkedZip: { zipBytes: Uint8Array; rootPath: string } | null = null;\n\n          const treatAsLocalPath = !isHttpUrl(from) && await pathExists(from);\n          const isGithubSource = looksLikeRepoUrl(from) || (isGithubShorthand(from) && !treatAsLocalPath);\n\n          if (isHttpUrl(from) || isGithubSource) {\n            if (!looksLikeRepoUrl(from) && !isGithubShorthand(from)) {\n              throw new Error(\n                \"Only GitHub URLs and local paths are supported for import. \" +\n                \"Generic HTTP URLs are not supported. Use a GitHub or GitHub Enterprise URL (https://github.com/... or https://ghe.example.com/...) or a local directory path.\",\n              );\n            }\n            sourcePayload = { type: \"github\", url: normalizeGithubImportSource(from, opts.ref) };\n          } else {\n            if (opts.ref?.trim()) {\n              throw new Error(\"--ref is only supported for GitHub import sources.\");\n            }\n            chunkedZip = await resolveChunkedImportZip(\n              from,\n              target === \"existing\"\n                ? EXISTING_COMPANY_CHUNKED_IMPORT_THRESHOLD_BYTES\n                : CHUNKED_IMPORT_THRESHOLD_BYTES,\n            );\n            if (chunkedZip) {\n              // Too large for one request: the zip travels as a chunked\n              // transfer, so the inline files map is never built or sent.\n              sourcePayload = { type: \"inline\", rootPath: chunkedZip.rootPath, files: {} };\n            } else {\n              const inline = await resolveInlineSourceFromPath(from);\n              sourcePayload = {\n                type: \"inline\",\n                rootPath: inline.rootPath,\n                files: inline.files,\n              };","sourceCodeStart":1697,"sourceCodeEnd":1733,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/cli/src/commands/client/company.ts#L1697-L1733","documentation":"--ref was supplied while the import source is not GitHub (local path or inline bundle), and ref pinning is only meaningful for GitHub source payloads.","triggerScenarios":"Thrown at cli/src/commands/client/company.ts:1715 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Drop --ref, or use a GitHub import source if a ref is required."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}