本文整理汇总了Java中org.eclipse.jgit.api.Status.getModified方法的典型用法代码示例。如果您正苦于以下问题:Java Status.getModified方法的具体用法?Java Status.getModified怎么用?Java Status.getModified使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jgit.api.Status
的用法示例。
在下文中一共展示了Status.getModified方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleAdded
import org.eclipse.jgit.api.Status; //导入方法依赖的package包/类
private Set<String> handleAdded(Status status) {
Set<String> toAdd = new HashSet<String>();
// go over untracked files
for (String untracked : status.getUntracked()) {
// add it to the index
toAdd.add(untracked);
}
// go over modified files
for (String modified : status.getModified()) {
// adds a modified entry to the index
toAdd.add(modified);
}
handleGlobalFileExtensions(toAdd);
handleJazzignores(toAdd);
return toAdd;
}
示例2: isCommitNecessary
import org.eclipse.jgit.api.Status; //导入方法依赖的package包/类
/**
* @param gitConfigFolder e.g. /your/project/root/.git
*
* @return Returns true if 'git status' has modified files inside the 'Changes to be committed' section
*/
public static boolean isCommitNecessary( String gitConfigFolder ) throws MojoExecutionException {
try {
Repository repo = new FileRepository( gitConfigFolder );
Git git = new Git( repo );
Status status = git.status().call();
Set<String> modified = status.getModified();
return ( modified.size() != 0 );
}
catch ( Exception e ) {
throw new MojoExecutionException( "Error trying to find out if git commit is needed", e );
}
}
示例3: getModifiedFiles
import org.eclipse.jgit.api.Status; //导入方法依赖的package包/类
private static Set<String> getModifiedFiles(Git git) throws NoWorkTreeException, GitAPIException {
Status status = git.status().call();
return status.getModified();
}
示例4: getModifiedFiles
import org.eclipse.jgit.api.Status; //导入方法依赖的package包/类
/**
* Calls `git status` and returns the set of modified files that Git reports.
*
* Modified files differ between the disk and the index
*
* @return a set of modified filenames in the working directory.
* @throws GitAPIException if the `git status` call fails.
*/
private Set<String> getModifiedFiles(Status status) throws GitAPIException {
if(status == null) {
status = new Git(this.getCurrentRepo()).status().call();
}
return status.getModified();
}