mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 23:45:44 +01:00
added diff endpoint which returns a parsed diff as json
This commit is contained in:
@@ -11,13 +11,14 @@ type Props = WithTranslation & {
|
||||
|
||||
class ChangesetDiff extends React.Component<Props> {
|
||||
isDiffSupported(changeset: Changeset) {
|
||||
return !!changeset._links.diff;
|
||||
return changeset._links.diff || !!changeset._links.diffParsed;
|
||||
}
|
||||
|
||||
createUrl(changeset: Changeset) {
|
||||
if (changeset._links.diff) {
|
||||
const link = changeset._links.diff as Link;
|
||||
return link.href + "?format=GIT";
|
||||
if (changeset._links.diffParsed) {
|
||||
return (changeset._links.diffParsed as Link).href;
|
||||
} else if (changeset._links.diff) {
|
||||
return (changeset._links.diff as Link).href + "?format=GIT";
|
||||
}
|
||||
throw new Error("diff link is missing");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user