MCPcopy Create free account
hub / github.com/fastrepl/anarlog / buildPublishedEditBranchName

Function buildPublishedEditBranchName

apps/web/src/functions/github-content.ts:186–200  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

184}
185
186function buildPublishedEditBranchName(filePath: string): string {
187 const collection = getCollectionFromPath(filePath);
188 if (!collection) {
189 return generateBranchName(filePath);
190 }
191
192 const token = getBranchToken(filePath);
193 const prefix = getBranchPrefix(collection);
194
195 if (collection === "articles") {
196 return `${prefix}/${token}-${Date.now()}`;
197 }
198
199 return `${prefix}/${token}-${Date.now()}`;
200}
201
202function getExistingBranchPrefix(filePath: string): string {
203 const collection = getCollectionFromPath(filePath);

Callers 1

ensureContentEditBranchFunction · 0.85

Calls 4

getCollectionFromPathFunction · 0.85
generateBranchNameFunction · 0.85
getBranchTokenFunction · 0.85
getBranchPrefixFunction · 0.85

Tested by

no test coverage detected