class GitManager {

    public GitCommitEntry deleteFile(Pipeline pipeline,
                                     String filePath,
                                     String lastCommitId,
                                     String commitMessage) throws GitClientException {
        Assert.isTrue(lastCommitId.equals(pipeline.getCurrentVersion().getCommitId()),
                messageHelper.getMessage(MessageConstants.ERROR_REPOSITORY_FILE_WAS_UPDATED, filePath));
        GitlabClient gitlabClient = this.getGitlabClientForPipeline(pipeline);

        GitPushCommitActionEntry gitPushCommitActionEntry = new GitPushCommitActionEntry();
        gitPushCommitActionEntry.setAction("delete");
        gitPushCommitActionEntry.setFilePath(filePath);

        GitPushCommitEntry gitPushCommitEntry = new GitPushCommitEntry();
        gitPushCommitEntry.setCommitMessage(commitMessage);
        gitPushCommitEntry.getActions().add(gitPushCommitActionEntry);
        return gitlabClient.commit(gitPushCommitEntry);
    }

}