* Parses a file externalId back into its repository ID and path. Returns null * when the externalId is not a file ID.
(externalId: string)
| 198 | * when the externalId is not a file ID. |
| 199 | */ |
| 200 | function parseFileExternalId(externalId: string): { repoId: string; path: string } | null { |
| 201 | if (!externalId.startsWith(FILE_PREFIX)) return null |
| 202 | const rest = externalId.slice(FILE_PREFIX.length) |
| 203 | const sep = rest.indexOf(':') |
| 204 | if (sep === -1) return null |
| 205 | return { repoId: rest.slice(0, sep), path: rest.slice(sep + 1) } |
| 206 | } |
| 207 | |
| 208 | /** |
| 209 | * Builds the change-detection hash for a repository file. The git blob objectId |