Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Commit

Permalink
feat: add support for remove_source_branch
Browse files Browse the repository at this point in the history
Add GitLab feature 'remove_source_branch' to provider.

Relates to #166
  • Loading branch information
KnisterPeter committed Oct 3, 2017
1 parent 51262af commit ac60cd1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@
"github.statusbar.failureText": {
"type": "string",
"description": "Overrides the default failure text."
},
"github.gitlab.removeSourceBranch": {
"type": "boolean",
"description": "GitLab setting to 'remove_source_branch' per MergeRequest.",
"default": false
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ export interface Configuration {
pendingText?: string;
failureText?: string;
};
gitlab: {
removeSourceBranch?: boolean;
};
}
1 change: 1 addition & 0 deletions src/provider/gitlab/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export interface CreateMergeRequestBody {
target_branch: string;
title: string;
description?: string;
remove_source_branch?: boolean;
}

export interface GetMergeRequestParameters {
Expand Down
4 changes: 3 additions & 1 deletion src/provider/gitlab/repository.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getConfiguration } from '../../helper';
import { Response } from '../client';
import { Issue } from '../issue';
import {
Expand Down Expand Up @@ -110,7 +111,8 @@ export class GitLabRepository implements Repository {
const gitlabBody: CreateMergeRequestBody = {
source_branch: body.sourceBranch,
target_branch: body.targetBranch,
title: body.title
title: body.title,
remove_source_branch: getConfiguration().gitlab.removeSourceBranch
};
if (body.body) {
gitlabBody.description = body.body;
Expand Down

0 comments on commit ac60cd1

Please sign in to comment.