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

Method getDifferences

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

Source from the content-addressed store, hash-verified

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