MCPcopy Create free account
hub / github.com/decaporg/decap-cms / getDifferences

Method getDifferences

packages/decap-cms-backend-bitbucket/src/API.ts:590–615  ·  view source on GitHub ↗
(source: string, destination: string = this.branch)

Source from the content-addressed store, hash-verified

588 }
589
590 async getDifferences(source: string, destination: string = this.branch) {
591 if (source === destination) {
592 return [];
593 }
594 const rawDiff = await this.requestText({
595 url: `${this.repoURL}/diff/${source}..${destination}`,
596 params: {
597 binary: false,
598 },
599 });
600
601 const diffs = parse(rawDiff).map(d => {
602 const oldPath = d.oldPath?.replace(/b\//, '') || '';
603 const newPath = d.newPath?.replace(/b\//, '') || '';
604 const path = newPath || (oldPath as string);
605 return {
606 oldPath,
607 newPath,
608 status: d.status,
609 newFile: d.status === 'added',
610 path,
611 binary: d.binary || /.svg$/.test(path),
612 };
613 });
614 return diffs;
615 }
616
617 async editorialWorkflowGit(
618 files: (DataFile | AssetProxy)[],

Callers 3

editorialWorkflowGitMethod · 0.95
allEntriesByFolderMethod · 0.45

Calls 2

mapMethod · 0.80
replaceMethod · 0.80

Tested by

no test coverage detected