public static void main(String[] args) throws IOException, GitAPIException { try (Repository repository = CookbookHelper.openJGitCookbookRepository()) { try (Git git = new Git(repository)) { Status status = git.status().call(); System.out.println("Added: " + status.getAdded()); System.out.println("Changed: " + status.getChanged()); System.out.println("Conflicting: " + status.getConflicting()); System.out.println("ConflictingStageState: " + status.getConflictingStageState()); System.out.println("IgnoredNotInIndex: " + status.getIgnoredNotInIndex()); System.out.println("Missing: " + status.getMissing()); System.out.println("Modified: " + status.getModified()); System.out.println("Removed: " + status.getRemoved()); System.out.println("Untracked: " + status.getUntracked()); System.out.println("UntrackedFolders: " + status.getUntrackedFolders()); } } } }
public static void main(String[] args) throws IOException, GitAPIException { try (Repository repository = CookbookHelper.openJGitCookbookRepository()) { try (Git git = new Git(repository)) { Status status = git.status().call(); System.out.println("Added: " + status.getAdded()); System.out.println("Changed: " + status.getChanged()); System.out.println("Conflicting: " + status.getConflicting()); System.out.println("ConflictingStageState: " + status.getConflictingStageState()); System.out.println("IgnoredNotInIndex: " + status.getIgnoredNotInIndex()); System.out.println("Missing: " + status.getMissing()); System.out.println("Modified: " + status.getModified()); System.out.println("Removed: " + status.getRemoved()); System.out.println("Untracked: " + status.getUntracked()); System.out.println("UntrackedFolders: " + status.getUntrackedFolders()); } } } }
Map<String, StageState> conflictingStageState = status.getConflictingStageState(); for(Map.Entry<String, StageState> entry : conflictingStageState.entrySet()) { System.out.println("ConflictingState: " + entry);
Map<String, StageState> conflictingStageState = status.getConflictingStageState(); for(Map.Entry<String, StageState> entry : conflictingStageState.entrySet()) { System.out.println("ConflictingState: " + entry);
sbInfo.append("Changed: ").append(status.getChanged()).append("\n"); sbInfo.append("Conflicting: ").append(status.getConflicting()).append("\n"); sbInfo.append("ConflictingStageState: ").append(status.getConflictingStageState()).append("\n"); sbInfo.append("IgnoredNotInIndex: ").append(status.getIgnoredNotInIndex()).append("\n"); sbInfo.append("Missing: ").append(status.getMissing()).append("\n");
private Status getStatus() throws GitSubsystemException { Status status; try { status = git.status().call(); } catch ( NoWorkTreeException | GitAPIException e ) { throw new GitSubsystemException( "Failed to retrieve status of: %s. Reason: %s", e, rootDir, e.getMessage() ); } final Map<String, StageState> css = status.getConflictingStageState(); if ( !css.isEmpty() ) { throw new GitSubsystemException( "%s contains conflicts. Cannot auto-commit.\n %s", rootDir, new JoinString( "\n ", css.entrySet() ) ); } return status; }
Collection<String> modified = status.getModified(); Collection<String> missing = status.getMissing(); Map<String, StageState> conflicting = status.getConflictingStageState();
private void handleConflict(File patchDirectory, Git fork, boolean preferNew, String cpPrefix, boolean performBackup, String choose, String backup, boolean rollback) throws GitAPIException, IOException { Map<String, IndexDiff.StageState> conflicts = fork.status().call().getConflictingStageState(); DirCache cache = fork.getRepository().readDirCache();
private void handleConflict(File patchDirectory, Git fork, boolean preferNew, String cpPrefix, boolean performBackup, String choose, String backup, boolean rollback) throws GitAPIException, IOException { Map<String, IndexDiff.StageState> conflicts = fork.status().call().getConflictingStageState(); DirCache cache = fork.getRepository().readDirCache();
Collection<String> untracked = status.getUntracked(); Map<String, StageState> unmergedStates = status .getConflictingStageState(); Collection<String> toBeCommitted = new ArrayList<String>(added); toBeCommitted.addAll(changed);