当前位置: 首页>>代码示例>>Java>>正文


Java JGitInternalException类代码示例

本文整理汇总了Java中org.eclipse.jgit.api.errors.JGitInternalException的典型用法代码示例。如果您正苦于以下问题:Java JGitInternalException类的具体用法?Java JGitInternalException怎么用?Java JGitInternalException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


JGitInternalException类属于org.eclipse.jgit.api.errors包,在下文中一共展示了JGitInternalException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: run

import org.eclipse.jgit.api.errors.JGitInternalException; //导入依赖的package包/类
@Override
protected void run () throws GitException {
    Repository repository = getRepository();
    File workTree = repository.getWorkTree();
    org.eclipse.jgit.api.SubmoduleStatusCommand cmd = new Git(repository).submoduleStatus();
    for (String path : Utils.getRelativePaths(workTree, roots)) {
        cmd.addPath(path);
    }
    try {
        Map<String, SubmoduleStatus> result = cmd.call();
        GitClassFactory fac = getClassFactory();
        for (Map.Entry<String, SubmoduleStatus> e : result.entrySet()) {
            File root = new File(workTree, e.getKey());
            statuses.put(root, fac.createSubmoduleStatus(e.getValue(), root));
        }
    } catch (GitAPIException | JGitInternalException ex) {
        throw new GitException(ex);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:SubmoduleStatusCommand.java

示例2: run

import org.eclipse.jgit.api.errors.JGitInternalException; //导入依赖的package包/类
@Override
protected void run () throws GitException {
    Repository repository = getRepository();
    try {
        RevObject obj = Utils.findObject(repository, taggedObject);
        TagCommand cmd = new Git(repository).tag();
        cmd.setName(tagName);
        cmd.setForceUpdate(forceUpdate);
        cmd.setObjectId(obj);
        cmd.setAnnotated(message != null && !message.isEmpty() || signed);
        if (cmd.isAnnotated()) {
            cmd.setMessage(message);
            cmd.setSigned(signed);
        }
        cmd.call();
        ListTagCommand tagCmd = new ListTagCommand(repository, getClassFactory(), false, new DelegatingGitProgressMonitor(monitor));
        tagCmd.run();
        Map<String, GitTag> tags = tagCmd.getTags();
        tag = tags.get(tagName);
    } catch (JGitInternalException | GitAPIException ex) {
        throw new GitException(ex);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:CreateTagCommand.java

示例3: cloneRepository

import org.eclipse.jgit.api.errors.JGitInternalException; //导入依赖的package包/类
@Override
public GitMaterial cloneRepository(GitMaterial gitMaterial) {
    try {
        CredentialsProvider credentials = this.handleCredentials(gitMaterial);
        Git.cloneRepository()
                .setURI(gitMaterial.getRepositoryUrl())
                .setCredentialsProvider(credentials)
                .setDirectory(new File(gitMaterial.getDestination()))
                .setCloneSubmodules(true)
                .call();

        gitMaterial.setErrorMessage("");

        return null;
    } catch (GitAPIException | JGitInternalException e) {
        gitMaterial.setErrorMessage(e.getMessage());
        return gitMaterial;
    }
}
 
开发者ID:rndsolutions,项目名称:hawkcd,代码行数:20,代码来源:GitService.java

示例4: main

import org.eclipse.jgit.api.errors.JGitInternalException; //导入依赖的package包/类
public static void main(String args[]) throws IOException, JGitInternalException, GitAPIException, URISyntaxException{
       String in = "������³˹��³˹������˹����˹��³˹������˹�Ǹ�����";
       String str = "��³˹������˹";
    	int lastIndexOf = blackAction.lastIndexOf(str, in);
    	System.out.println(lastIndexOf);
//       String path = "d://test//git//test01";
//       String path2 = "C://Users//Administrator//Documents//blacktest//2017.01.133";
//       String[] s = new String[]{"refs/heads/nov","refs/heads/master"};
//       
//       ArrayList<RevCommit> commits = gitTool.getCommitsFromBranch(path, s);
//       for(RevCommit r:commits){
//    	   System.out.println(r.getFullMessage());
//       }
//       
//      
//   
    }
 
开发者ID:piiiiq,项目名称:Black,代码行数:18,代码来源:test.java

示例5: forceUpdate

import org.eclipse.jgit.api.errors.JGitInternalException; //导入依赖的package包/类
private void forceUpdate(final RefUpdate ru,
                         final ObjectId id) throws java.io.IOException, ConcurrentRefUpdateException {
    final RefUpdate.Result rc = ru.forceUpdate();
    switch (rc) {
        case NEW:
        case FORCED:
        case FAST_FORWARD:
            break;
        case REJECTED:
        case LOCK_FAILURE:
            throw new ConcurrentRefUpdateException(JGitText.get().couldNotLockHEAD,
                                                   ru.getRef(),
                                                   rc);
        default:
            throw new JGitInternalException(MessageFormat.format(JGitText.get().updatingRefFailed,
                                                                 Constants.HEAD,
                                                                 id.toString(),
                                                                 rc));
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:21,代码来源:SimpleRefUpdateCommand.java

示例6: execute

import org.eclipse.jgit.api.errors.JGitInternalException; //导入依赖的package包/类
public OpNotification execute() throws Exception {
    Log.d(TAG, "Starting execute... directory=" + directory);
    ensureFolderExists(directory.getParentFile());

    try {
        cloneRepository()
                .setBare(bare)
                .setDirectory(directory)
                .setURI(sourceUri.toPrivateString())
                .setProgressMonitor(messagingProgressMonitor)
                .setTransportConfigCallback(transportConfigCallback)
                .setCredentialsProvider(credentialsProvider)
                .call();

        Log.d(TAG, "Completed checkout!");
    } catch (JGitInternalException e) {
        throw exceptionWithFriendlyMessageFor(e);
    } finally {
        repoUpdateBroadcaster.broadcastUpdate();
    }

    return new OpNotification(stat_sys_download_done, "Cloned "
            + sourceUri.getHumanishName(), "Clone completed",
            sourceUri.toString());
}
 
开发者ID:m4rzEE1,项目名称:ninja_chic-,代码行数:26,代码来源:Clone.java

示例7: setCustomTemplateInRepo

import org.eclipse.jgit.api.errors.JGitInternalException; //导入依赖的package包/类
@Override
public void setCustomTemplateInRepo(String repositoryUrl, String cloneRepo) {
	File tmpDir = Files.createTempDir();
	log.info("Creating clone in {}", tmpDir.getPath());
	try {
		Git git;
		if (cloneRepo == null) {
			git = copyDefaultTemplate(tmpDir);
		} else {
			git = cloneRepo(cloneRepo, tmpDir);
		}
		pushClonedRepoToOurRepository(repositoryUrl, git);

	} catch (IOException | JGitInternalException | GitAPIException | URISyntaxException e) {
		log.error("Could not instantiate repo", e);
		throw new DevHubException("Could not instantiate repo", e);
	} finally {
		boolean deleted = FileUtils.deleteQuietly(tmpDir);
		log.debug("Temporary template deletion succes = {}", deleted);
	}

}
 
开发者ID:devhub-tud,项目名称:devhub-prototype,代码行数:23,代码来源:GitRepositoryUtils.java

示例8: call

import org.eclipse.jgit.api.errors.JGitInternalException; //导入依赖的package包/类
@Override
public String call() throws GitAPIException {
	try {
		DirCache index = repo.lockDirCache();
		DirCacheEntry entry = index.getEntry(fileName);

		if (entry != null) {
			entry.setAssumeValid(assumeUnchanged);
			index.write();
			index.commit();
			return entry.getPathString();
		}
	} catch (IOException e) {
		throw new JGitInternalException(e.getMessage(), e);
	}

	return null;
}
 
开发者ID:centic9,项目名称:jgit-cookbook,代码行数:19,代码来源:UpdateIndex.java

示例9: call

import org.eclipse.jgit.api.errors.JGitInternalException; //导入依赖的package包/类
@Override
public Ref call() throws GitAPIException, RefNotFoundException,
	CheckoutConflictException, InvalidRefNameException,
	RefAlreadyExistsException
{
	this.checkCallable();
	try {
		this.processOptions();
		this.checkoutStartPoint();
		RefUpdate update = this.getRepository().updateRef(Constants.HEAD);
		Result r = update.link(this.getBranchName());
		if (EnumSet.of(Result.NEW, Result.FORCED).contains(r) == false) {
			throw new JGitInternalException(MessageFormat.format(
				JGitText.get().checkoutUnexpectedResult, r.name()));
		}
		this.setCallable(false);
		return this.getRepository().getRef(Constants.HEAD);
	}
	catch (IOException e) {
		throw new JGitInternalException(e.getMessage(), e);
	}
}
 
开发者ID:uw-loci,项目名称:github-backup-java,代码行数:23,代码来源:CreateOrphanBranchCommand.java

示例10: run

import org.eclipse.jgit.api.errors.JGitInternalException; //导入依赖的package包/类
@Override
protected void run () throws GitException {
    Repository repository = getRepository();
    File workTree = repository.getWorkTree();
    org.eclipse.jgit.api.SubmoduleInitCommand cmd = new Git(repository).submoduleInit();
    for (String path : Utils.getRelativePaths(workTree, roots)) {
        cmd.addPath(path);
    }
    try {
        cmd.call();
        statusCmd.run();
    } catch (GitAPIException | JGitInternalException ex) {
        throw new GitException(ex);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:SubmoduleInitializeCommand.java

示例11: testCommit

import org.eclipse.jgit.api.errors.JGitInternalException; //导入依赖的package包/类
/**
    * �����ύ����
    */
    @Test
    public void testCommit() throws IOException, GitAPIException,
            JGitInternalException {
        //git�ֿ��ַ
        Git git = new Git(new FileRepository(localPath+"/.git"));
        //�ύ����
        git.commit().setMessage("������ļ�")
        .setAuthor("������", "[email protected]")
        //.setAll(true)
        .call();
//        git.commit().setMessage("д�����ļ�")
//        .call();
    }
 
开发者ID:piiiiq,项目名称:Black,代码行数:17,代码来源:test.java

示例12: testPush

import org.eclipse.jgit.api.errors.JGitInternalException; //导入依赖的package包/类
/**
* push���ش��뵽Զ�ֿ̲��ַ
*/
@Test
public void testPush() throws IOException, JGitInternalException,
        GitAPIException {

    UsernamePasswordCredentialsProvider usernamePasswordCredentialsProvider =new
            UsernamePasswordCredentialsProvider(username,password);
    //git�ֿ��ַ
    Git git = new Git(new FileRepository(localPath+"/.git")); 
    
    git.push().setRemote(remotePath).setCredentialsProvider(usernamePasswordCredentialsProvider)
    .setPushAll()
    .call();
}
 
开发者ID:piiiiq,项目名称:Black,代码行数:17,代码来源:test.java

示例13: getCauseDescription

import org.eclipse.jgit.api.errors.JGitInternalException; //导入依赖的package包/类
private String getCauseDescription(Throwable cause) {
  if (cause == null) {
    return "";
  } else if (JGitInternalException.class.isAssignableFrom(cause.getClass())) {
    Throwable innerCause = cause.getCause();
    return innerCause != null ? getCauseDescription(cause.getCause()) : "JGit internal error";
  } else {
    return getDecamelisedName(cause);
  }
}
 
开发者ID:GerritCodeReview,项目名称:plugins_github,代码行数:11,代码来源:GitCloneFailedException.java

示例14: commit

import org.eclipse.jgit.api.errors.JGitInternalException; //导入依赖的package包/类
@SneakyThrows
public void commit(Path caminho, String mensagem, UserProfile profile) {
    PersonIdent ident = new PersonIdent(profile.getName(), profile.getEmail());
    try {
        RevCommit result = git.commit()
                .setMessage(mensagem)
                .setCommitter(ident)
                .setAuthor(ident)
                .setOnly(caminho.toString())
                .call();

        Marker marker = append("commit", result.getName())
                .and(append("commit.message", mensagem))
                .and(append("commit.author", ident.getName()))
                .and(append("commit.email", ident.getEmailAddress()))
                .and(append("commit.path", caminho.toString()))
                .and(append("git.branch", git.getRepository().getBranch()))
                .and(append("git.state", git.getRepository().getRepositoryState().toString()));

        log.info(marker, "git commit {}", caminho);

    } catch (JGitInternalException e) {
        if (e.getMessage().equals(JGitText.get().emptyCommit)) {
            log.info("Commit não possui alterações em {}", caminho);
        } else {
            throw e;
        }
    }
}
 
开发者ID:servicosgovbr,项目名称:editor-de-servicos,代码行数:30,代码来源:RepositorioGit.java

示例15: push

import org.eclipse.jgit.api.errors.JGitInternalException; //导入依赖的package包/类
public void push(String projectName, String branchName, String username, String password) throws IOException, JGitInternalException,
	GitAPIException {
	CredentialsProvider cp = new UsernamePasswordCredentialsProvider(username, password);
	Iterable<PushResult> pushResult = getGitObject(projectName, branchName).getGitInstance().push().setCredentialsProvider(cp).call();
	System.out.println("Push result: ");
	for(PushResult res : pushResult) {
		System.out.println(res.toString());
	}
}
 
开发者ID:FTSRG,项目名称:mondo-collab-framework,代码行数:10,代码来源:MondoGitHandler.java


注:本文中的org.eclipse.jgit.api.errors.JGitInternalException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。