Package playRepository

Examples of playRepository.GitRepository$CloneAndFetch


        initRepository(pullRequest.fromProject,
                StringUtils.removeStart(pullRequest.fromBranch, "refs/heads/"), "2.txt");
    }

    private void initRepository(Project project, String branchName, String fileName) throws Exception {
        GitRepository gitRepository = new GitRepository(project);
        gitRepository.create();

        Repository repository = GitRepository.buildMergingRepository(project);
        Git git =  new Git(repository);

        FileUtils.touch(new File(GitRepository.getDirectoryForMerging(project.owner, project.name + "/" + fileName)));
        git.add().addFilepattern(fileName).call();
        git.commit().setMessage(fileName).call();
        git.push().setRefSpecs(new RefSpec("master:master"), new RefSpec("master:" + branchName)).call();
        gitRepository.close();
        repository.close();
    }
View Full Code Here


        project.name = name;
        return project;
    }

    private static void createRepository(Project project) throws Exception {
        GitRepository gitRepository = new GitRepository(project);
        gitRepository.create();
        gitRepository.close();
    }
View Full Code Here

public class BranchApp extends Controller {

    @IsAllowed(Operation.READ)
    public static Result branches(String loginId, String projectName) throws IOException, GitAPIException {
        Project project = Project.findByOwnerAndProjectName(loginId, projectName);
        GitRepository gitRepository = new GitRepository(project);
        List<GitBranch> allBranches = gitRepository.getAllBranches();
        final GitBranch headBranch = gitRepository.getHeadBranch();

        // filter the head branch from all branch list.
        CollectionUtils.filter(allBranches, new Predicate() {
            @Override
            public boolean evaluate(Object o) {
View Full Code Here

    }

    @IsAllowed(Operation.UPDATE)
    public static Result setAsDefault(String loginId, String projectName, String branchName) throws IOException, GitAPIException {
        Project project = Project.findByOwnerAndProjectName(loginId, projectName);
        GitRepository gitRepository = new GitRepository(project);
        gitRepository.setDefaultBranch(branchName);

        return utils.HttpUtil.isRequestedWithXHR(request()) ? ok() : redirect(routes.BranchApp.branches(loginId, projectName));
    }
View Full Code Here

TOP

Related Classes of playRepository.GitRepository$CloneAndFetch

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.