class GitManager {

    public GitCommitEntry modifyFile(Pipeline pipeline,
                                     PipelineSourceItemVO sourceItemVO) throws GitClientException {
        String sourcePath = sourceItemVO.getPath();
        Arrays.stream(sourcePath.split(PATH_DELIMITER)).forEach(pathPart ->
            Assert.isTrue(GitUtils.checkGitNaming(pathPart),
                messageHelper.getMessage(MessageConstants.ERROR_INVALID_PIPELINE_FILE_NAME, sourcePath)));
        if (StringUtils.isNullOrEmpty(sourceItemVO.getPreviousPath())) {
            return this.updateFile(pipeline,
                    sourcePath,
                    sourceItemVO.getContents(),
                    sourceItemVO.getLastCommitId(),
                    sourceItemVO.getComment());
        } else {
            return this.renameFile(pipeline,
                    sourcePath,
                    sourceItemVO.getPreviousPath(),
                    sourceItemVO.getLastCommitId(),
                    sourceItemVO.getComment());
        }
    }

}