(source: string, destination: string = this.branch)
| 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)[], |
no test coverage detected