class GitManager {

    public GitCommitEntry createOrRenameFolder(Long id, PipelineSourceItemVO folderVO) throws GitClientException {
        String folderName = FilenameUtils.getName(folderVO.getPath());
        Assert.isTrue(GitUtils.checkGitNaming(folderName),
                messageHelper.getMessage(MessageConstants.ERROR_INVALID_FOLDER_NAME, folderName));
        Pipeline pipeline = pipelineManager.load(id, true);
        if (folderVO.getPreviousPath() == null) {
            // Previous path is missing: creating update
            return createFolder(pipeline,
                    folderVO.getPath(),
                    folderVO.getLastCommitId(),
                    folderVO.getComment());
        } else {
            // else: renaming update
            return renameFolder(pipeline,
                    folderVO.getPreviousPath(),
                    folderVO.getPath(),
                    folderVO.getLastCommitId(),
                    folderVO.getComment());
        }
    }

}