Examples of GitScmProviderRepository


Examples of org.apache.maven.scm.provider.git.repository.GitScmProviderRepository

        if ( !fileSet.getFileList().isEmpty() )
        {
            throw new ScmException( "This provider doesn't support branching subsets of a directory" );
        }

        GitScmProviderRepository repository = (GitScmProviderRepository) repo;

        Commandline cl = createCommandLine( repository, fileSet.getBasedir(), branch );

        CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer();
        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
View Full Code Here

Examples of org.apache.maven.scm.provider.git.repository.GitScmProviderRepository

     */
    protected ScmResult executeAddCommand( ScmProviderRepository repo, ScmFileSet fileSet, String message,
                                           boolean binary )
        throws ScmException
    {
        GitScmProviderRepository repository = (GitScmProviderRepository) repo;

        if ( fileSet.getFileList().isEmpty() )
        {
            throw new ScmException( "You must provide at least one file/directory to add" );
        }
View Full Code Here

Examples of org.apache.maven.scm.provider.git.repository.GitScmProviderRepository

        if ( !fileSet.getFileList().isEmpty() )
        {
            throw new ScmException( "This provider doesn't support tagging subsets of a directory" );
        }

        GitScmProviderRepository repository = (GitScmProviderRepository) repo;

        File messageFile = FileUtils.createTempFile( "maven-scm-", ".commit", null );

        try
        {
View Full Code Here

Examples of org.apache.maven.scm.provider.git.repository.GitScmProviderRepository

    private ScmUrlParserResult parseScmUrl( String scmSpecificUrl, char delimiter )
        throws ScmException
    {
        ScmUrlParserResult result = new ScmUrlParserResult();

        result.repository = new GitScmProviderRepository( scmSpecificUrl );

        return result;
    }
View Full Code Here

Examples of org.apache.maven.scm.provider.git.repository.GitScmProviderRepository

    @Override
    protected ScmProviderRepository getScmProviderRepository()
        throws Exception
    {
        return new GitScmProviderRepository( getScmUrl().substring( "scm:jgit:".length() ) );
    }
View Full Code Here

Examples of org.apache.maven.scm.provider.git.repository.GitScmProviderRepository

     */
    protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repo, ScmFileSet fileSet,
                                                        ScmVersion version, boolean recursive )
        throws ScmException
    {
        GitScmProviderRepository repository = (GitScmProviderRepository) repo;

        if ( GitScmProviderRepository.PROTOCOL_FILE.equals( repository.getFetchInfo().getProtocol() )
            && repository.getFetchInfo().getPath().indexOf( fileSet.getBasedir().getPath() ) >= 0 )
        {
            throw new ScmException( "remote repository must not be the working directory" );
        }

        Git git = null;
        try
        {

            ProgressMonitor monitor = JGitUtils.getMonitor( getLogger() );

            String branch = version != null ? version.getName() : null;

            if ( StringUtils.isBlank( branch ) )
            {
                branch = Constants.MASTER;
            }

            getLogger().debug( "try checkout of branch: " + branch );

            if ( !fileSet.getBasedir().exists() || !( new File( fileSet.getBasedir(), ".git" ).exists() ) )
            {
                if ( fileSet.getBasedir().exists() )
                {
                    // git refuses to clone otherwise
                    fileSet.getBasedir().delete();
                }

                // FIXME only if windauze
                WindowCacheConfig cfg = new WindowCacheConfig();
                cfg.setPackedGitMMAP( false );
                cfg.install();

                // no git repo seems to exist, let's clone the original repo
                CredentialsProvider credentials = JGitUtils.getCredentials( (GitScmProviderRepository) repo );
                getLogger().info( "cloning [" + branch + "] to " + fileSet.getBasedir() );
                git = Git.cloneRepository().setURI( repository.getFetchUrl() ).setCredentialsProvider( credentials ).setBranch( branch ).setDirectory( fileSet.getBasedir() ).setProgressMonitor( monitor ).call();
            }

            JGitRemoteInfoCommand remoteInfoCommand = new JGitRemoteInfoCommand();
            remoteInfoCommand.setLogger( getLogger() );
            RemoteInfoScmResult result = remoteInfoCommand.executeRemoteInfoCommand( repository, fileSet, null );
View Full Code Here

Examples of org.apache.maven.scm.provider.git.repository.GitScmProviderRepository

    public RemoteInfoScmResult executeRemoteInfoCommand( ScmProviderRepository repository, ScmFileSet fileSet,
                                                         CommandParameters parameters )
        throws ScmException
    {

        GitScmProviderRepository repo = (GitScmProviderRepository) repository;
        Git git = null;
        try
        {
            git = Git.open( fileSet.getBasedir() );
            CredentialsProvider credentials = JGitUtils.getCredentials( repo );

            LsRemoteCommand lsCommand =
                git.lsRemote().setRemote( repo.getPushUrl() ).setCredentialsProvider( credentials );

            Map<String, String> tag = new HashMap<String, String>();
            Collection<Ref> allTags = lsCommand.setHeads( false ).setTags( true ).call();
            for ( Ref ref : allTags )
            {
View Full Code Here

Examples of org.apache.maven.scm.provider.git.repository.GitScmProviderRepository

     *      org.apache.maven.scm.ScmFileSet, java.lang.String,
     *      org.apache.maven.scm.ScmVersion)
     */
    protected CheckInScmResult executeCheckInCommand(ScmProviderRepository repo, ScmFileSet fileSet, String message, ScmVersion version)
        throws ScmException {
        GitScmProviderRepository repository = (GitScmProviderRepository) repo;

        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
        CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer();

        int exitCode;
View Full Code Here

Examples of org.apache.maven.scm.provider.git.repository.GitScmProviderRepository

     *      org.apache.maven.scm.ScmFileSet, org.apache.maven.scm.ScmVersion,
     *      boolean)
     */
    protected CheckOutScmResult executeCheckOutCommand(ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion version,
            boolean recursive) throws ScmException {
        GitScmProviderRepository repository = (GitScmProviderRepository) repo;

        if (GitScmProviderRepository.PROTOCOL_FILE.equals(repository.getFetchInfo().getProtocol())
                && repository.getFetchInfo().getPath().indexOf(fileSet.getBasedir().getPath()) >= 0) {
            throw new ScmException("remote repository must not be the working directory");
        }

        int exitCode;

View Full Code Here

Examples of org.apache.maven.scm.provider.git.repository.GitScmProviderRepository

        // by a *custom* implementation
        @Override
        protected CheckInScmResult executeCheckInCommand(
                ScmProviderRepository repo, ScmFileSet fileSet, String message, ScmVersion version ) throws ScmException {

            GitScmProviderRepository repository = (GitScmProviderRepository) repo;

            CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
            CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer();

            int exitCode;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.