Skip to content

Commit

Permalink
Default to MR changes if no base/head
Browse files Browse the repository at this point in the history
  • Loading branch information
rohit-gohri committed Feb 25, 2020
1 parent ccc11df commit a112547
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion source/platforms/gitlab/GitLabAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,10 @@ class GitLabAPI {
}
}

getCompareChanges = async (base: string, head: string): Promise<GitLabMRChange[]> => {
getCompareChanges = async (base?: string, head?: string): Promise<GitLabMRChange[]> => {
if (!base || !head) {
return this.getMergeRequestChanges()
}
const api = this.api.Repositories
const projectId = this.repoMetadata.repoSlug
const compare = (await api.compare(projectId, base, head)) as GitLabRepositoryCompare
Expand Down
2 changes: 1 addition & 1 deletion source/platforms/gitlab/GitLabGit.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { debug } from "../../debug"
import { GitLabDSL, GitLabMRChange } from "../../dsl/GitLabDSL"
import { GitDSL, GitJSONDSL } from "../../dsl/GitDSL"
import { gitJSONToGitDSL, GitJSONToGitDSLConfig, GitStructuredDiff } from "../git/gitJSONToGitDSL"
import { gitJSONToGitDSL, GitJSONToGitDSLConfig } from "../git/gitJSONToGitDSL"
import GitLabAPI from "./GitLabAPI"

const d = debug("GitLabGit")
Expand Down

0 comments on commit a112547

Please sign in to comment.