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


Java RmCommand类代码示例

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


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

示例1: addDeletedFilesToIndexIfNeeded

import org.eclipse.jgit.api.RmCommand; //导入依赖的package包/类
/** To add deleted files in index it is required to perform git rm on them */
private void addDeletedFilesToIndexIfNeeded(List<String> filePatterns) throws GitAPIException {
  Set<String> deletedFiles = getGit().status().call().getMissing();
  if (deletedFiles.isEmpty()) {
    return;
  }
  if (!filePatterns.isEmpty() && !filePatterns.contains(".")) {
    deletedFiles =
        deletedFiles.stream().filter(filePatterns::contains).collect(Collectors.toSet());
  }
  if (!deletedFiles.isEmpty()) {
    RmCommand rmCommand = getGit().rm();
    deletedFiles.forEach(rmCommand::addFilepattern);
    rmCommand.call();
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:17,代码来源:JGitConnection.java

示例2: rm

import org.eclipse.jgit.api.RmCommand; //导入依赖的package包/类
@Override
public void rm(RmParams params) throws GitException {
  List<String> files = params.getItems();
  RmCommand rmCommand = getGit().rm();

  rmCommand.setCached(params.isCached());

  if (files != null) {
    files.forEach(rmCommand::addFilepattern);
  }
  try {
    rmCommand.call();
  } catch (GitAPIException exception) {
    throw new GitException(exception.getMessage(), exception);
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:17,代码来源:JGitConnection.java

示例3: delete

import org.eclipse.jgit.api.RmCommand; //导入依赖的package包/类
@Override
public void delete(File... files) throws IOException {
  Repository repository = getRepository(files[0]);
  Git git = new Git(repository);
  try {
    RmCommand remover = git.rm();
    for (File file : files) {
      remover.addFilepattern(getPath(file, repository));
    }
    remover.call();
    commit(git, String.format("[FitNesse] Deleted files: %s.", formatFiles(files)), null);
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
  persistence.delete(files);
}
 
开发者ID:fitnesse,项目名称:fitnesse-git-plugin,代码行数:17,代码来源:GitFileVersionsController.java

示例4: addAll

import org.eclipse.jgit.api.RmCommand; //导入依赖的package包/类
/**
 * Adds multiple files to the staging area. Preparing the for commit
 * 
 * @param fileNames
 *          - the names of the files to be added
 */
public void addAll(List<FileStatus> files) {

	try {
	  
	  RmCommand removeCmd = null;
	  AddCommand addCmd = null;
	  
		for (FileStatus file : files) {
			if (file.getChangeType() == GitChangeType.MISSING) {
			  if (removeCmd == null) {
			    removeCmd = git.rm();
			  }
         removeCmd.addFilepattern(file.getFileLocation());
			} else {
			  if (addCmd == null) {
			    addCmd = git.add();
			  }
         addCmd.addFilepattern(file.getFileLocation());
			}
		}
		
		if (removeCmd != null) {
		  removeCmd.call();
		}
		
		if (addCmd != null) {
		  addCmd.call();
		}
		
		fireFileStateChanged(new ChangeEvent(GitCommand.STAGE, getPaths(files)));
	} catch (GitAPIException e) {
		if (logger.isDebugEnabled()) {
			logger.debug(e, e);
		}
	}
}
 
开发者ID:oxygenxml,项目名称:oxygen-git-plugin,代码行数:43,代码来源:GitAccess.java

示例5: clearDirectory

import org.eclipse.jgit.api.RmCommand; //导入依赖的package包/类
private void clearDirectory(File dir) throws MojoExecutionException {
    RmCommand rm = git.rm();
    if (forEachPath(dir, rm::addFilepattern)) {
        try {
            rm.call();
        } catch (GitAPIException e) {
            throw new MojoExecutionException("Could not remove files from directory and git", e);
        }
    }
}
 
开发者ID:windy1,项目名称:ghp-maven-plugin,代码行数:11,代码来源:GitHubPages.java

示例6: removeFiles

import org.eclipse.jgit.api.RmCommand; //导入依赖的package包/类
/**
 * @see gov.va.isaac.interfaces.sync.ProfileSyncI#removeFiles(java.io.File, java.util.Set)
 */
@Override
public void removeFiles(String... files) throws IllegalArgumentException, IOException
{
	try
	{
		log.info("Remove Files called {}", Arrays.toString(files));
		Git git = getGit();
		if (files.length == 0)
		{
			log.debug("No files to remove");
		}
		else
		{
			RmCommand rm = git.rm();
			for (String file : files)
			{
				rm.addFilepattern(file);
			}
			rm.call();
		}
		log.info("removeFiles Complete.  Current status: " + statusToString(git.status().call()));
	}
	catch (GitAPIException e)
	{
		log.error("Unexpected", e);
		throw new IOException("Internal error", e);
	}
}
 
开发者ID:Apelon-VA,项目名称:ISAAC,代码行数:32,代码来源:SyncServiceGIT.java


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